1//Create the ArrayList
2List<Integer> al = new ArrayList<>();
3//Add the items
4al.add(10);
5al.add(18);
6//Remove item(1 = 2and item in list)
7al.remove(1);
1public static void main(String[] args) {
2
3ArrayList<String> names = new ArrayList<>(Arrays.asList("Ahmed", "John", "Eric", "Ahmed"));
4 names.removeAll( Arrays.asList("Ahmed"));
5 System.out.println(names); // [John, Eric]