* What is "= and equals ()"? =: 1. determine whether the basic type variables are equal; 2. determine whether the reference type points to an object; equals (): determines whether the value pointed to by the reference type variable is the same (String is the standard, but can be rewritten ); * How to use "= and equals ()"? String str1 = "Hello"; String str2 = "Hello"; // output falsestr1 = str2; // output truestr1.equals (str2 ); * Why we use "= and equals ()"? Here we will talk about equals (). This method is of the Object class and can be rewritten. The meaning of rewriting is that "you can define equal standards by yourself. How do you think it is equal, in extreme cases, if you rewrite this method and always return a true value, then how can the ratios be equal. * Others: correctly override the principles of the equals method: Self-inversion, symmetry, transmission, consistency, and false for any x. equals (null) that is not null.