看下面的程序,结果是。。。

Posted on 2009-06-29 12:34  云之上  阅读(107)  评论(0编辑  收藏  举报

public class Test1 {
 /**
  * @param args
  */
 public static void main(String[] args) {
  String s1 = "abc";
  String s2 = "abc";
  System.out.println(s1==s2);
  s1 = s1 +"abc";
  s2 = s2 +"abc";
  System.out.println(s1==s2);

 }

}

 

结果

true
false

Copyright © 2024 云之上
Powered by .NET 8.0 on Kubernetes