Quiz · Collections and generics · lesson 4 of 13
Quiz — remove(1) on a List<Integer>
What does the program print?
import java.util.ArrayList;
public class Main {
public static void main(String[] args) {
ArrayList<Integer> xs = new ArrayList<>();
xs.add(10);
xs.add(20);
xs.add(30);
xs.remove(1);
System.out.println(xs);
}
}