What will be the output of the following code?
import java.util.*;
public class Test {
public static void main(String[] args) {
ArrayList<Integer> list = new ArrayList<>();
list.add(1);
list.add(2);
list.add(3);
list.remove(1);
System.out.println(list);
}
}
[1, 3]
[2, 3]
[1, 2]
[1, 2, 3]
This question is part of this quiz :
Java ArrayList