Return | Method | Summary |
---|---|---|
boolean | contains(Object o) | Returns true if this list contains the specified element. |
import java.util.ArrayList;
import java.util.List;
public class Main {
public static void main(String args[]) {
ArrayList<String> al = new ArrayList<String>();
al.add("C");
al.add("A");
al.add("E");
al.add("java2s.com");
al.add("D");
al.add("F");
al.add(1, "java2s.com");
System.out.println(al);
System.out.println(al.contains("java2s.com"));
}
}
The output:
[C, java2s.com, A, E, java2s.com, D, F]
true
java2s.com | Contact Us | Privacy Policy |
Copyright 2009 - 12 Demo Source and Support. All rights reserved. |
All other trademarks are property of their respective owners. |