FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[Original HTTPS Page]
Java-code/MapSort at master · michaelgermini/Java-code · GitHub
michaelgermini
Java-code
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
Java-code
/
MapSort
/
Copy path
Directory actions
More options
More options
Directory actions
More options
More options
Latest commit
History
History
History
Breadcrumbs
Java-code
/
MapSort
/
Copy path
Folders and files
Name
Name
Last commit message
Last commit date
parent directory
..
src/
com/
hmkcode
src/
com/
hmkcode
README.md
README.md
README.md
SORT JAVA MAP BY KEYS AND VALUES
"Key,Value" order in Java HashMap is not guaranteed.
Sorting a Map type class by "keys" is given by TreeMap, just TreeMap.putAll(map) will return sorted map by keys.
Sorting a Map by "values" needs one more step, we need to define a Comparator that compares values to each other.
Back
|
FazBrowse Home
|
New Git URL