java contains method arraylist code example
Example 1: list contains
List<Integer> arr = new ArrayList<Integer>(4);
boolean ans = arr.contains(2);
Example 2: java arraylist contains string
boolean ans = arr.contains("geeks");
Example 3: arraylist contains doc
ArrayList<String> strings=new ArrayList<String>();
boolean ans = arr.contains("geeks"); //ans=false