• Post Reply Bookmark Topic Watch Topic
  • New Topic

hash code and Equals methods  RSS feed

 
Seetharamireddy Mittala
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need clear explanation about these two methodss please help .
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

These methods have nothing to do with Threads, so I'm going to move your question to the "Java in General (Beginner)" forum.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The equals() method tests the equality of two object references by their content. You should read thoroughly the documentation in java.lang.Object to review how equality is understood in this context.

The hashCode() method is used as a way to identify an object in memory. The "hash" itself is an alogorithm used to ensure any object's hashcode is always the same, and all objects in one system are uniquely identifiable. Again, you should read the documentation for java.lang.Object for a deeper understanding of this method's purpose.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!