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