关于Integer比较问题

 1 public class Test {
 2     public static void main(String[] args) {
 3         Integer a=127;
 4         Integer b=127;
 5         System.out.println(a==b);
 6         System.out.println(a.equals(b));
 7         Integer c=128;
 8         Integer d=128;
 9         System.out.println(c==d);
10         System.out.println(c.equals(d));
11         Integer e=0;
12         Integer f=null;
13         System.out.println(e==f);
14         System.out.println(e.equals(f));
15     }
16 }

猜你喜欢

转载自www.cnblogs.com/xQlover/p/10240722.html