public class Demo{
public static void main(String[] args) {
int a = 10000;
int b = 10000;
Integer A = 10000;
Integer B = 10000;
System.out.println(a==b);//true
System.out.println(A==B);//false
}
}
案例二
代码语言:javascript复制
public class Demo{
public static void main(String[] args) {
int a = 127;
int b = 127;
Integer A = 127;
Integer B = 127;
System.out.println(a==b);//true
System.out.println(A==B);//true
}
}
案例三
代码语言:javascript复制
public class Demo{
public static void main(String[] args) {
double a = 127d;
double b = 127d;
Double A = 127d;
Double B = 127d;
System.out.println(a==b);//true
System.out.println(A==B);//false
}
}