I have a doubt in HashMap. In the following I am putting an key & value pair m1.put(saveobj1, 1). I am getting the value by giving the key as m2.get(saveobj1). Also, I tried giving key as m2.get(saveobj2). It gives the same result. I am putting only the saveobj1. But, how am I getting the same result for the key saveobj2? Can any of you please explain this?