Suppose, I have a HashMap:
HashMap<MyKey, Integer> HM = new HashMap<MyKey, Integer>();
MyKey corresponds to a data object with two integer elements (and a constructor for passing two integers).
HM.put(new MyKey(1,1234), 1); // this seems to work...
but, I cannot seem to use it:
System.out.println(HM.containsKey(new MyKey(1,1234)));
I get false.
Can a HashMap have a custom data object for a Key? What am I missing? Thanks...