aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes KB page no 526 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "KB page no 526" Watch "KB page no 526" New topic
Author

KB page no 526

sumaraghavi ragha
Ranch Hand

Joined: Nov 17, 2006
Posts: 118
Hi all,

Please explain me the following table i am not able to understand it

Remember that the equals(), hashCode(), and toString() methods are
all public. The following would not be a valid override of the equals() method, although
it might appear to be if you don�t look closely enough during the exam:
class Foo { boolean equals(Object o) { } }
And watch out for the argument types as well. The following method is an
overload, but not an override of the equals() method:
class Boo { public boolean equals(Boo b) { } }

thanks in advance
winay Kumar
Ranch Hand

Joined: Aug 13, 2007
Posts: 34
Hi,

In this "class Foo { boolean equals(Object o) { } }" its not valid because access modifier is more restrict then the Object class equals method

In this "class Boo { public boolean equals(Boo b) { } }" its overloaded because equals method argument list is different compare to Object class equals method.


Winay Kumar<br />SCJP 5.0
 
Don't get me started about those stupid light bulbs.
 
subject: KB page no 526