一路拾遗
Collect By Finding All The Way ......
posts - 81,comments - 41,trackbacks - 0
public static void main(String[] args) {
  Integer a ;
  Integer b ;

  a
=16;
  b
=16;

  System.out.println(a 
== b);
  System.out.println(a.equals(b));
}
输出true  true

public static void main(String[] args) {
Integer a ;
Integer b ;

a
=128;
b
=128;

System.out.println(a 
== b);
System.out.println(a.equals(b));
}

输出false true

public static void main(String[] args) {
Integer a 
= new Integer(5);
Integer b 
= new Integer(5);

System.out.println(a 
== b);
System.out.println(a.equals(b));
}
输出false ture
posted on 2010-05-27 16:19 胖胖泡泡 阅读(179) 评论(0)  编辑  收藏

只有注册用户登录后才能发表评论。


网站导航: