I'm trying to sort a HashMap by values. I know that it might not be "good style", but it would save a lot of work, as I wouldn't have to rewrite lots of code if I could just get the HashMap sorted by value.
After lots of searching and trial and error cases I'm still stuck.
The HashMap itself is still unsorted.
import java.util.* ; public class H { static HashMap first = new HashMap(); static { first.put("20030120" , new Integer (56)); first.put("20030118" , new Integer (19)); first.put("20030125" , new Integer (25));