I need to loop through a HashMap, but to give importance to the values' order.
For example, consider the following hash map of <String, Integer>
:
{"dog" : 2, "bird": 3, "cat" : 1}
Now, I need to loop through the hasp map in order of ascending values, so that
for () {
System.out.println( currentKey );
}
will always output
"cat", "dog", "bird"