sort hashtable by values

I have hashtable with keys= String and Values= int

i want to sort by values and I didn't understand what the iterator

do in this code:

TreeMap oleSorted =new TreeMap(ht);

Set keys = oleSorted.keySet();

List reverseKeys =new ArrayList(keys);

Collections.reverse(reverseKeys);

Iterator it = reverseKeys.iterator();

[432 byte] By [tavirama] at [2007-10-2 5:44:08]
# 1
If I understand correctly, you can just add another TreeMap that uses Integer keys and String values.
tschodta at 2007-7-16 1:54:09 > top of Java-index,Core,Core APIs...