FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[Original HTTPS Page]
Java/MapSort at master · mapmap0220/Java · GitHub
mapmap0220
Java
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
Java
/
MapSort
/
Copy path
Directory actions
More options
More options
Directory actions
More options
More options
Latest commit
History
History
History
Breadcrumbs
Java
/
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