posted 18 years ago
I need to sort hashmap based on values and not keys.. one more concern here is the values are duplicate..
the hash map has data like
HashMap hashMap=new HashMap();
hashMap.put("aaa",new Integer("333"));
hashMap.put("bbb",new Integer("111"));
hashMap.put("ccc",new Integer("444"));
hashMap.put("eee",new Integer("222"));
hashMap.put("ggg",new Integer("333"));
after sorting the map shuld have the data like
hashMap.put("bbb",new Integer("111"));
hashMap.put("eee",new Integer("222"));
hashMap.put("aaa",new Integer("333"));
hashMap.put("ggg",new Integer("333"));
hashMap.put("ccc",new Integer("444"));
can you please help me in solving this...