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

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


          網站導航:
           
          主站蜘蛛池模板: 叶城县| 乐安县| 大连市| 繁昌县| 遂宁市| 湘潭市| 静宁县| 句容市| 株洲市| 梁平县| 遂溪县| 沛县| 庆城县| 上林县| 临泽县| 修武县| 武宁县| 永安市| 杭锦后旗| 巴林左旗| 台湾省| 太白县| 绵阳市| 杭锦旗| 西华县| 望都县| 安陆市| 楚雄市| 磐石市| 古丈县| 广平县| 江陵县| 册亨县| 芮城县| 呼玛县| 盱眙县| 舒兰市| 建德市| 尚志市| 通榆县| 景东|