This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes Java in General and the fly likes Hashcode & equals Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "Hashcode & equals" Watch "Hashcode & equals" New topic
Author

Hashcode & equals

siva mail
Greenhorn

Joined: Jan 25, 2009
Posts: 19
Hi Ranchers ,

Can you please tell me how Hashcode & Equals are related to each other. I didnt get how equals & Hashcode methods are called when you are calling get method on HashMap. In what are all scenarios these Hashcode & Equals are called internally.

your help is Appreciated

Thanks in advance
Siva
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19232

Check out the API for Object. The contract for both methods, and the relation between them, is quite clearly documented.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: Hashcode & equals
 
Similar Threads
Avoiding equals override
Problem getting value from HashMap
Reg Hashcodes
Question about hashSet
equals() and hashcode()