This week's book giveaway is in the JavaFX forum.
We're giving away four copies of Introducing JavaFX 8 Programming and have Herbert Schildt 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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Introducing JavaFX 8 Programming this week in the JavaFX forum!
JavaRanch » Java Forums » Java » Java in General
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: 20128
    
  30

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 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hashcode & equals
 
jQuery in Action, 3rd edition