posted 16 years ago
I want to know how Equals and Hashcode is actually used when we are adding/fetching data into/from collections, say HashMap.
for Adding we provide a key and value pair and for fetching we provide just a key.So how the elements are stored using hashcode and how they are fetched using Equals and hashcode. I tried searching a lot in the internet, but still i cannot understand the working. I am clear with the working of Hashcode and Equals method and their contract. If you can explain with a simple example then it will be helpful.
Regards,
Chander
Enjoy, Chander
SCJP 5, Oracle Certified PL/SQL Developer