| Author |
override equals
|
Haythem Ben Yahia
Greenhorn
Joined: Nov 29, 2012
Posts: 3
|
|
hi,
i'm studying with the book of kathy Sierra and i wanna pass the SCJP but i foud a problem:
i didn't understand why we used to override equals() at the page 582.what is the goal of doing that.
thank you
|
 |
Haythem Ben Yahia
Greenhorn
Joined: Nov 29, 2012
Posts: 3
|
|
i found the problem.the original equals() it is like ==.so x.equals(y) return true if & if only x==y.
if 2 objects have the same parameter then it will be not equal with this method.so we need to modify it.
|
 |
 |
|
|
subject: override equals
|
|
|