<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # 匿名對象 ## 匿名對象的概念 只有創建對象的時候,沒有將該對象的地址賦值給某一個引用變量 > 語法:new 類名(參數列表); ## 匿名對象的特點 沒有任何引用變量指向 當方法調用完畢之后,該對象就變成了垃圾對象.會在垃圾回收器空閑時被回收 > gc----->garbage collect ## 匿名對象的使用場景 當對象只需要調用某個方法一次時,可以使用匿名對象 作為方法的實際參數 ## 代碼說明 ``` public static void main(String[] args) { // 創建人 // 有名的對象,對象名為P Person p = new Person("lisi", 23); p.showInfo(); // 匿名對象 // 只有創建對象的語句,沒有將該對象的地址賦值給某一個引用變量 new Person("zhongson", 23); new Person("zhongson", 23).showInfo(); // 創建集合 // 集合調用匿名對象 ArrayList<Person> List = new ArrayList<>(); List.add(new Person("zhongson", 20)); List.add(new Person("zhongson", 20)); List.add(new Person("zhongson", 20)); } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看