list.contains method in java code example Example: list contains List arr = new ArrayList(4); boolean ans = arr.contains(2);