public class str {
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
System.out.println(j==k);//false
float a = 1.0f;
System.out.println(i==a);
//System.out.println(i.equals(a));编译出错
Integer b = 128;
Integer c = 128;
Integer d = new Integer(128);
int e = 128;
System.out.println(b==c);//false //超过128开辟另一个地址
System.out.println(b==d);//false
System.out.println(b==e);//true
System.out.println(d==e);//true
}
}