A List
isn't a real thing in Java. It's an interface, a way of defining how an object is allowed to interact with other objects. As such, it can't ever be instantiated. An ArrayList
is an implementation of the List
interface, as is a linked list, and so on. Use those instead.