关于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 }

 

posted @ 2019-01-08 18:34  &傻小子  阅读(142)  评论(0编辑  收藏  举报