I have this HashMap that I need to print out in ascending order according to the values contained in it (not the keys
HashMap
the for loop of for(Map.Entry entry: codes.entrySet()) didn't work for me. Used Iterator instead.
codes.entrySet()
Iterator> i = codes.entrySet().iterator(); while(i.hasNext()){ String key = i.next().getKey(); System.out.println(key+", "+codes.get(key)); }