wood burning stoves 2.0*
The moose likes Java in General and the fly likes Can I Override equals() and hashCode() in my class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Can I Override equals() and hashCode() in my class" Watch "Can I Override equals() and hashCode() in my class" New topic
Author

Can I Override equals() and hashCode() in my class

Mahi Ranga
Ranch Hand

Joined: Jan 27, 2011
Posts: 35
Hi,

I have one doubt ,i.e Can I Override equals() and hashCode() in my class.If i override these two methods what will happen.

Thanks in Advace.

Regards,
Mahi.
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3056
    
  33

Yes you can override.
For what will happen on overriding you can have search for similar posts in this Forum ( SearchFirst )


Mohamed Sanaulla | My Blog
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can I Override equals() and hashCode() in my class
 
Similar Threads
equal() & hashcode() override (Kathy Sierra)
enums
Problem with mock exam question
if we override hashCode method is compulsary to override equals method and viseversa.
Overriding hashCode() and equals()