class Test{ public static void main(String[] args){ //当值在[-128,127]中,不创建新的Integer Integer f1 = 100,f2 = 100,f3 = 150, f4 = 150; System.out.println(f1 == f2); //true System.out.println(f3 == f4); //false } }
class Test{ public static void main(String[] args){ //当值在[-128,127]中,不创建新的Integer Integer f1 = 100,f2 = 100,f3 = 150, f4 = 150; System.out.println(f1 == f2); //true System.out.println(f3 == f4); //false } }