Java API, common object, and javaapi object
I. Object Class
Overview: a. root class of the class hierarchy
B. All classes are directly or indirectly inherited from the class.
Ii. Constructor
Public Object ()
The subclass constructor accesses the non-argument constructor of the parent class by default.
Iii. Member Methods
1. public int hashCode ()
A. Return the hash value of the object. By default, this method is calculated based on the object address.
B. The hashCode () of different objects will not be the same in general.
2. public final Class getClass ()
A. Return the runtime class of this Object
B. You can use a method in the Class to obtain the full name of the real Class of the object.
3. public String toString ()
A. Return the String of this object to indicate public String toString (){
Return name + "," + age;
}
B. Its value is equal:
GetClass (). getName () + "@" + Integer. toHexString (hashCode ())
C. The data by default is meaningless to us.
4. equals method of Object Class