---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
问题:直接看下面的代码:
Long a1 = 1l; Long b1 = 1l; System.out.println(a1 == b1); Long a2 = new Long(1); Long b2 = 1l; System.out.println(a2 == b2);
public boolean equals(Object obj) { if (obj instanceof Long) { return value == ((Long)obj).longValue(); } return false; }
原文地址:http://blog.csdn.net/afirsraftgarrier/article/details/46634451