posts - 15,  comments - 5,  trackbacks - 0
class TestString {
 public static void main(String[] args) {
  String hello = "Hello", lo = "lo";
  System.out.print((hello == "Hello") + " ");
  System.out.print((Other.hello == hello) + " ");
  System.out.print((other.OtherString.hello == hello) + " ");
  System.out.print((hello == ("Hel" + "lo")) + " ");
  System.out.print((hello == ("Hel" + lo)) + " ");
  System.out.println((hello == ("Hel" + lo).intern()));
 }
}

class Other {
 static String hello = "Hello";
}

package other;
public class OtherString {
 public static String hello = "Hello";
}

输出结果是什么呢?:)
posted on 2005-11-25 18:22 MudFish 阅读(268) 评论(1)  编辑  收藏 所属分类: JSP

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


网站导航: