import java.util.ArrayList; public class Example { public static void main(String[] args) { // creating the list of integer type ArrayList <Integer> numList = new ArrayList<>(); // add elements to the array numList.add(0); numList.add(1); numList.add(2); numList.add(3); numList.add(4); System.out.println(numList); // remove the elements of the array numList.remove(1); numList.remove(2); System.out.println(numList); } }