Integer i5 = 127;
Integer i6 = 127;
System.out.println(i5 == i6); 1 ture
System.out.println(i5.equals(i6)); 2 ture
System.out.println("-----------");-------------------------------------------------------------------------
Integer i5 = 128;
Integer i6 = 128; System.out.println(i5 == i6); 1 false System.out.println(i5.equals(i6)); 2 ture System.out.println("-----------");
为啥变成128就错了呢?
|