| Author |
equals() & hashCode() method in Object class
|
shan sundaram
Greenhorn
Joined: Feb 07, 2004
Posts: 15
|
|
Hi, What is the use of equals() & hashCode() method? where/how to use it? Thanks in advance, V.Shanmugam.
|
 |
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
|
|
|
Have you looked at the JavaDocs for the Object class?
|
JavaRanch FAQ HowToAskQuestionsOnJavaRanch
|
 |
Eitan Levi
Greenhorn
Joined: Jun 14, 2006
Posts: 14
|
|
|
In case you're asking because you're interested in overriding them for your own classes, there's a really good article on JavaWorld: How to avoid traps and correctly override methods from java.lang.Object. It shows you how to properly override the equals and hashCode methods.
|
 |
 |
|
|
subject: equals() & hashCode() method in Object class
|
|
|