Equals method: Test if an object is equal to another object, just like "=" is to determine whether the two objects point to a memory area. (Generally no) generally overload this method. Java requires the equals method: 1 : Determination x.equals (x); // Return True; 2: Containing IF X.Equals (Y) Return True, THEN Y.EQUALS (X) Return True.3: Transmission X.Equals (Y ), y.Equals (z) => x.equals (z); 4: Consistency If the object of XY reference does not change the X.Equals (Y) return result is constant; 5: For any empty reference x.equals (null I should return false; so I've written Equals method: 1> Do not call OtherObject first to convert it into another variable for other Other .2> Test this is equal to OtherObject; if (this == OtherObject) Return True; 3 > Test whether OtherObject is empty if (OtherObject == NULL) Return False; 4> Does this with other IF (GetClass ()! = OtherObject.getClass ()) Return False5> Convert OtherObject to your class Type; other = (your class) OtherObject6> Compare all field returnild1 == other.field1 &&field2 == Other.field2 && ... toString Returns a string of string, such as Point, such as Point, Returns java.aw .Point [x = 10, y = 20]