aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes override equals Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "override equals" Watch "override equals" New topic
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.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: override equals
 
Similar Threads
about equals
compare object
object equals() method
Invoking Object superclass's method outside of subclass when the method is overriden?
Map and Set