Copy codeThe Code is as follows: public class extends sdemo {
Public static void main (String [] args ){
/* Use = to determine whether two variables are equal.
If the values of the two variables are equal, true is returned if the values of the two variables are equal */
Int I = 65;
Float f = 65.0f;
System. out. println (I = f); // true
Char c = 'a ';
System. out. println (c = f); // true
// But for two variables of the reference type, true is returned only when they point to the same object and =
String str1 = new String ("hello ");
String str2 = new String ("hello ");
System. out. println (str1 = str2); // false
System. out. println (str1.equals (str2); // true
}
}
Copy codeThe Code is as follows: public class IntegerDemo {
Public static void main (String [] args ){
Integer i1 = 127;
Integer i2 = 127;
System. out. println (i1 = i2); // true
Integer i3 = 128;
Integer i4 = 128;
System. out. println (i3 = i4); // false
// Metadata Mode
}
}