本帖最后由 liuelxiwd 于 2013-5-18 08:45 编辑
- Integer a1 = 100;
- Integer a2 = 100;
- System.out.println(a1 == a2); // true
-
- Integer b1 = new Integer(100);
- Integer b2 = new Integer(100);
- System.out.println(b1 == b2); // false
-
- Integer c1 = 150;
- Integer c2 = 150;
- System.out.println(c1 == c2); // false
复制代码 关于==和equals的问题好多人都问题,哪位大侠来给大家总结一个集合文档,惠及一下小黑马们·~~
|