Object Class
Object Class
Object class :
● Object class is defined in java.lang package.
● Object class is a supermost parent class for all the classes in java.
● One no argument constructor is there.
NOTE :
● If equals(Object ) method is not overridden it compares the reference of two
objects similar to == operator.
● If equals(Object) method is overridden it compares the state of two objects,
in such case comparing the reference of two objects is possible only by ==
operator.
Design tip :
In equals method compare the state of an current(this) object with the passed
object by downcasting the passed object.