HashMap<String,Integer> map = new HashMap<String,Integer>();
map.put("a", 4);
map.put("c", 6);
map.put("b", 2);
Desired output(HashMap):
c : 6
a : 4
b : 2
I haven't been able to find anything about Descending the order by value.
How can this be achieved? (Extra class not preferred)
List entries = new ArrayList<Entry<String,Integer>>(hash.getEntries()); then sort that.