The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
The equals() method is a special method contained in the Object class that compares properties between two objects. The properties that the method tests are determined by the type of object being tested. This is in contrast to the == operator, which tests whether two reference variables are the same, as described earlier in the chapter.
The equals() method is typically overridden in a subclass. When this method is not overridden, it is identical to the == operator (it compares two reference variables). For the Java exam you will need to know the behavior of String, Boolean, and Object types.
I just want to know how many these Subclasses are .
Originally posted by Ths SG: Well I am preparing for the SCJP 1.4 exam. Do I need to know this?
No you don't need to know this. You *do* need to know how and where to find out whether or not a class does override the equals() method. And while you're reading the appropriate docs check if that class overrides the hasCode() method also, if not, start revolting and sending in bug reports. kind regards ps. My guess is that *nobody* knows from the top of his/her head how many classes override these methods ...
It would probably be easier to count the classes that DON'T override the equals method. However, such details aren't necessary for the exam. As stated, you need to know when to use the equals() method and how to find out if a class overrides this method. [ January 28, 2003: Message edited by: Layne Lund ]