posted 12 years ago
I am pasting you two code snippets.
1. Implementing hashcode() and equals() with HashSet:
2. Implementing hashcode() and equals() with HashMap:
My Question is :
While debugging with HashSet line by line I am able to find the flow entering into equals method when its get matched with two equal hashcodes.
But while I am debugging with HashMap line by line I am not able to find the flow entering into equals method when its get matched with two equal hashcodes.
So I am unable to understand how and when exactly equals gets called and why its not getting called with HashMap please somebody explain me this?
Or any link or reference to understand this...
Thanks in advance...