日期:2014-05-20 浏览次数:20662 次
public class TestEquals{ public static void main(String[] args){ Integer a = new Integer(128); Integer b = new Integer(128); System.out.println(a == b); System.out.println(a.equals(b)); Test t1 = new Test(); Test t2 = new Test(); System.out.println(t1 ==t2 ); System.out.println(t1.equals(t2)); } }