<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>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                # 用 Java 克隆`HashMap` > 原文: [https://beginnersbook.com/2014/08/clone-a-hashmap-in-java/](https://beginnersbook.com/2014/08/clone-a-hashmap-in-java/) #### 描述 克隆`HashMap`的程序。我們將使用`HashMap`類的以下方法來執行克隆。 `public Object clone()`:返回此`HashMap`實例的淺表副本:未克隆鍵和值本身。 #### 示例 ```java import java.util.HashMap; class HashMapExample{ public static void main(String args[]) { // Create a HashMap HashMap<Integer, String> hmap = new HashMap<Integer, String>(); // Adding few elements hmap.put(11, "Jack"); hmap.put(22, "Rock"); hmap.put(33, "Rick"); hmap.put(44, "Smith"); hmap.put(55, "Will"); System.out.println("HashMap contains: "+hmap); // Creating a new HashMap HashMap<Integer, String> hmap2 = new HashMap<Integer, String>(); // cloning first HashMap in the second one hmap2=(HashMap)hmap.clone(); System.out.println("Cloned Map contains: "+hmap2); } } ``` **輸出:** ```java HashMap contains: {33=Rick, 55=Will, 22=Rock, 11=Jack, 44=Smith} Cloned Map contains: {33=Rick, 55=Will, 22=Rock, 11=Jack, 44=Smith} ```
                  <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>

                              哎呀哎呀视频在线观看