ex4
Fri May 26 2023 12:36:30 GMT+0000 (Coordinated Universal Time)
Saved by
@gokulz
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);
}
}
content_copyCOPY
Comments