<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國際加速解決方案。 廣告
                # Java `ArrayList remove(Object obj)`方法 > 原文: [https://beginnersbook.com/2013/12/java-arraylist-removeobject-method-example/](https://beginnersbook.com/2013/12/java-arraylist-removeobject-method-example/) 方法`remove(Object obj)`從列表中刪除指定的對象。它屬于`java.util.ArrayList`類。 `public boolean remove(Object obj)` **注:** * 如果列表中不存在指定的元素,則返回`false`。 * 如果列表中存在重復元素,則會從列表中刪除指定元素的第一個匹配項。 ### 例 在這個例子中,我們有一個`ArrayList<String>`我們正從列表中刪除一些字符串。 ```java package beginnersbook.com; import java.util.ArrayList; public class RemoveExample { public static void main(String args[]) { //String ArrayList ArrayList<String> al = new ArrayList<String>(); al.add("AA"); al.add("BB"); al.add("CC"); al.add("DD"); al.add("EE"); al.add("FF"); System.out.println("ArrayList before remove:"); for(String var: al){ System.out.println(var); } //Removing element AA from the arraylist al.remove("AA"); //Removing element FF from the arraylist al.remove("FF"); //Removing element CC from the arraylist al.remove("CC"); /*This element is not present in the list so * it should return false */ boolean b=al.remove("GG"); System.out.println("Element GG removed: "+b); System.out.println("ArrayList After remove:"); for(String var2: al){ System.out.println(var2); } } } ``` 輸出: ```java ArrayList before remove: AA BB CC DD EE FF Element GG removed: false ArrayList After remove: BB DD EE ```
                  <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>

                              哎呀哎呀视频在线观看