I have a class which I want to set up as keys in HashMap. I already have implemented the compareTo method for that class. But still when I do:
map.put(new MyKey(dummyArguements) , dummyValue );
System.out.println(map.get( new MyKey(dummyArguements) ) );
You need to implement
compareTo() is additionally required for sorted map/set.
See this question for details.