Possible Duplicate:
How to sort a Map<Key, Value> on the values in Java?
Hello can you help me about my sortring problem
HashMap<String, Integer> hm = new HashMap<String, Integer>();
hm.put("Berkan Cetin", 100);
hm.put("Mahmut Koca", 78);
hm.put("Rifat Sarili", 89);
hm.put("Cagdas Polat", 61);
hm.put("Gulay Uygun", 56);
For example, in there if I want to sort by keys I can use TreeMap
or else, but I cant find way to sort from biggest to smallest Integer
according to values.
Thanks