Forums Register Login

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

+Pie Number of slices to send: Send
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.
+Pie Number of slices to send: Send
Yes you can override.
For what will happen on overriding you can have search for similar posts in this Forum ( SearchFirst )
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 607 times.
Similar Threads
Problem with mock exam question
if we override hashCode method is compulsary to override equals method and viseversa.
equal() & hashcode() override (Kathy Sierra)
Overriding hashCode() and equals()
enums
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 04:21:42.