Forums Register Login

equals Method?

+Pie Number of slices to send: Send
Hi Guys,

Is the equals method overriden in the collection interface or is it the one from the Object class??
+Pie Number of slices to send: Send
I think you answered your own question. Since it is an interface how would you go about providing an implementation ?
+Pie Number of slices to send: Send
Thanks John...
+Pie Number of slices to send: Send
 

Is the equals method overriden in the collection interface or is it the one from the Object class??


This first thing to be noted is that interfaces can not override the methods as you quoted it can only declare the methods to be overriden.

The equal() methods in each collection is overrided by the abstract classes which they extends.
java.lang.Object
|--- java.util.AbstractCollection
|--- java.util.AbstractList (equal() is overrided here)
|----java.util.ArrayList
[ December 17, 2006: Message edited by: Sanjeev Kumar Singh ]
+Pie Number of slices to send: Send
Sanjeev, thanks for the details.
This one time, at bandcamp, I had relations with a tiny ad.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 473 times.
Similar Threads
equals() to check equality of two objects
Mock Objects for easymock -- Assertion failure Error
HashSet ordering
Parameter value
How to check the two objects are same?
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 19, 2024 05:13:33.