<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 `ArrayList indexOf()`方法 > 原文: [https://beginnersbook.com/2013/12/java-arraylist-indexof-method-example/](https://beginnersbook.com/2013/12/java-arraylist-indexof-method-example/) `ArrayList`類方法`indexOf(Object o)`用于查找列表中特定元素的索引。 `public int indexOf(Object o)` 如果列表中不存在指定的元素,則此方法返回 -1。 ### 例 ```java package beginnersbook.com; import java.util.ArrayList; public class IndexOfExample { public static void main(String[] args) { ArrayList<String> al = new ArrayList<String>(); al.add("AB"); al.add("CD"); al.add("EF"); al.add("GH"); al.add("IJ"); al.add("KL"); al.add("MN"); System.out.println("Index of 'AB': "+al.indexOf("AB")); System.out.println("Index of 'KL': "+al.indexOf("KL")); System.out.println("Index of 'AA': "+al.indexOf("AA")); System.out.println("Index of 'EF': "+al.indexOf("EF")); } } ``` 輸出: ```java Index of 'AB': 0 Index of 'KL': 5 Index of 'AA': -1 Index of 'EF': 2 ``` #### 參考: [`ArrayList.indexOf(Object)`](https://docs.oracle.com/javase/7/docs/api/java/util/ArrayList.html#indexOf(java.lang.Object))
                  <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>

                              哎呀哎呀视频在线观看