Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Equals and HashCode methods quiry.

807601Mar 3 2008 — edited Mar 4 2008
Hi,
I would just like some information regarding the equals and the hasdcode methods in the java.lang.Object package. Ok I know that equals compares where two objects are the same.....same? how....take the same location in memory or are they the same type. Hashcode what is its point. What is it used for?

Finally, if you override the equals method why should you can the hashcode method too.

Thanks for your help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 1 2008
Added on Mar 3 2008
5 comments
704 views