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

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # 如何檢查`HashMap`是否為空? > 原文: [https://beginnersbook.com/2014/08/how-to-check-if-a-hashmap-is-empty-or-not/](https://beginnersbook.com/2014/08/how-to-check-if-a-hashmap-is-empty-or-not/) #### 描述 用于檢查`HashMap`是否為空的程序。我們使用`HashMap`類的`isEmpty()`方法來執行此檢查。 #### 程序 ```java import java.util.HashMap; class HashMapIsEmptyExample{ public static void main(String args[]) { // Create a HashMap HashMap<Integer, String> hmap = new HashMap<Integer, String>(); // Checking whether HashMap is empty or not /* isEmpty() method signature and description - * public boolean isEmpty(): Returns true if this map * contains no key-value mappings. */ System.out.println("Is HashMap Empty? "+hmap.isEmpty()); // Adding few elements hmap.put(11, "Jack"); hmap.put(22, "Rock"); hmap.put(33, "Rick"); hmap.put(44, "Smith"); hmap.put(55, "Will"); // Checking again System.out.println("Is HashMap Empty? "+hmap.isEmpty()); } } ``` **輸出:** ```java Is HashMap Empty? true Is HashMap Empty? false ```
                  <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>

                              哎呀哎呀视频在线观看