2020/1/31
public class Test{
public static void main(String[] args){
Integer i = 1;
Integer j = 1;
System.out.println(i == j);//false
}
}
public class Test{
public static void main(String[] args){
int i = 1;
Integer j = 1;
Integer k = new Integer(1);
System.out.println(i == j); //true
System.out.println(i == k); //true
}
}
public class Test{
public static void main(String[] args){
Integer i = 1;
Integer j = new Integer(1);
System.out.println(i == j); //false
}
}
public class Test{
public static void main(String[] args){
Integer i = 1;
Integer j = 1;
Integer k = 128;
Integer l = 128;
System.out.println(i == j); //true
System.out.println(k == l); //true
}
}
若有错误地方,请指出,谢谢大家
参考:
原文:https://www.cnblogs.com/wanwangogogo/p/12245230.html