contais arraylist java 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");
List arr = new ArrayList(4);
boolean ans = arr.contains(2);
boolean ans = arr.contains("geeks");