title: Setting own class as key in java Hashmap
body: <p>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:</p>
  
  <pre>
  map.put(new MyKey(dummyArguements) , dummyValue );
  System.out.println(map.get( new MyKey(dummyArguements) ) );
  </pre>
  
  <p>I get null.
  So that means hashmap is not able to identify that the two keys (for get &amp; put call) are same.</p>
  
  <p>Could someone help me here please ?</p>