[转载] How do I sort a map in Java?# Java - 爪哇娇娃
a*i
1 楼
【 以下文字转载自 Programming 讨论区 】
【 原文由 ayanami 所发表 】
Supppose I have a HashMap wordmap with a String key, a integer value.
[Key=>value]
What is the easiest way to sort them based on value?
I looked at SortMap, but it only sorts based on key.
Thanks!
【 原文由 ayanami 所发表 】
Supppose I have a HashMap wordmap with a String key, a integer value.
[Key=>value]
What is the easiest way to sort them based on value?
I looked at SortMap, but it only sorts based on key.
Thanks!