Skip to content
Quiz · Collections and generics · lesson 2 of 13

Quiz — List<int>

What happens when this program is compiled and run?

JAVA
import java.util.ArrayList;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        List<int> xs = new ArrayList<>();
        xs.add(5);
        System.out.println(xs);
    }
}