摘要: public static void test(){ Integer a=1; Integer b=1; System.out.println(a==b); System.out.println(a.equals(b)); } 输出结果可能大家都想到了是什么,没错就是: true true publ 阅读全文
posted @ 2018-02-27 10:55 帝国攻城狮 阅读(378) 评论(1) 推荐(0) 编辑
摘要: 1. int是基本数据类型,int变量存储的是数值。Integer是引用类型,实际是一个对象,Integer存储的是引用对象的地址。 2. Integer i = new Integer(100);Integer j = new Integer(100);System.out.print(i == 阅读全文
posted @ 2018-02-27 10:23 帝国攻城狮 阅读(8893) 评论(0) 推荐(4) 编辑