题目
Integer比较大小,写出下面每行代码的输出值
Integer a =123,b=123;
System.out.println(a==b); //1
System.out.println(a.equals(b)); //2
Integer a1 =12345,b1=12345;
System.out.println(a1==b1);//3
System.out.println(a1.equals(b1));//4
true (-128,127) 缓存
true
false
true 重写了equals
1
1
0
1
1
1
0
1
true
true
false
true
true
true
false
true
true
true
false
true
1
1
1
1