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 閱讀(276) 評論(1)  編輯  收藏 所屬分類: JSP

          只有注冊用戶登錄后才能發表評論。


          網站導航:
           
          主站蜘蛛池模板: 大洼县| 喀喇| 穆棱市| 招远市| 乐昌市| 银川市| 仁怀市| 富川| 石渠县| 吴堡县| 忻州市| 凌海市| 张家口市| 确山县| 余江县| 永新县| 淮安市| 东城区| 宜兰县| 九龙县| 定陶县| 壶关县| 女性| 德阳市| 讷河市| 东乡| 沁阳市| 马公市| 永福县| 大化| 建瓯市| 阿勒泰市| 凤翔县| 固阳县| 永新县| 马鞍山市| 镇平县| 留坝县| 哈密市| 阿荣旗| 尚义县|