arraylist contains on object code example Example: list contains List<Integer> arr = new ArrayList<Integer>(4); boolean ans = arr.contains(2);