Integer i = 10;
Integer j = 10;
System.out.println(i == j);//true
Integer a = 128;
Integer b = 128;
System.out.println(a == b);//false
System.out.println(a.equals(b));//true
当Integer数值大于127时使用等号比较时的问题
最新推荐文章于 2023-07-17 08:50:25 发布
Integer i = 10;
Integer j = 10;
System.out.println(i == j);//true
Integer a = 128;
Integer b = 128;
System.out.println(a == b);//false
System.out.println(a.equals(b));//true