Loading...

          java .net

          有意思的問題

          public class Test
          {
              public void changeApple(Apple a)
              {
                  Apple a2 = new Apple();
                  a2.color = "red";
                  a = a2;
              }
              public void changeApple2(Apple a)
              {
                  a.color = "red";
              }
              public static void main(String[] args)
              {
                  Apple a = new Apple();
                  a.color="blue";
                  new Test().changeApple(a);
                  System.out.println(a.color);
                  new Test().changeApple2(a);
                  System.out.println(a.color);
              }
          }
          class Apple
          {
              public String color;
          }

          //輸出結果:blue
                       red

          posted on 2008-08-26 22:06 閱讀(87) 評論(0)  編輯  收藏


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


          網站導航:
           

          公告

          希望有一天

          我能用鼠標雙擊我的錢包

          然后選中一張100元

          按住“ctrl+c”

          接著不停的“ctrl+v”

          嘻嘻~~~笑醒~~~



          導航

          <2008年8月>
          272829303112
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          統計

          常用鏈接

          留言簿(6)

          隨筆分類(102)

          隨筆檔案(398)

          文章分類

          文章檔案(10)

          有趣網絡

          搜索

          積分與排名

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 旌德县| 通道| 菏泽市| 揭东县| 尖扎县| 滨州市| 墨竹工卡县| 四会市| 辽源市| 乳山市| 日喀则市| 新安县| 华安县| 和林格尔县| 库伦旗| 磐安县| 苍山县| 崇阳县| 恭城| 雷州市| 泰宁县| 普安县| 辰溪县| 呼玛县| 旬邑县| 治县。| 分宜县| 石阡县| 平度市| 德江县| 土默特右旗| 桂平市| 汉沽区| 安阳市| 平利县| 剑川县| 丰原市| 恭城| 富蕴县| 奉贤区| 富裕县|