public class Test {
public static void main(String[] args) {
Integer i = 50;
Integer j = 50;
System.out.println(i==j);
Integer a = 500;
Integer b = 500;
System.out.println(a==b);
}
}
输出true,false
integer是引用类型,如果数据范围在byte范围内,jvm不会重新创建新的对象