List
is an interface. Interfaces cannot be instantiated. Only concrete types can be instantiated. You probably want to use an ArrayList
, which is an implementation of the List
interface.
List<Product> products = new ArrayList<Product>();
More Related Contents:
- Which Lists will/won’t compile?
- Iterate through a possibly infinite amount of nested ArrayLists
- How to create a Java ArrayList in C
- Difference between declaring variables before or in loop?
- How to sort a List/ArrayList?
- Convert list to array in Java [duplicate]
- How do you cast a List of supertypes to a List of subtypes?
- Is there a concurrent List in Java’s JDK?
- Java List.add() UnsupportedOperationException
- In Java how do you sort one list based on another?
- What is an initialization block?
- Initializing multiple variables to the same value in Java
- How can I sort a List alphabetically?
- UnsupportedOperationException when trying to remove from the list returned by Array.asList
- How do I convert a Map to List in Java?
- How to shuffle an ArrayList [duplicate]
- How to cast from List to double[] in Java?
- What is local/remote and no-interface view in EJB?
- Java: Casting from List to List when B implements A?
- Java Sort List of Lists
- Why can’t you have a “List” in Java? [duplicate]
- What kind of List does Collectors.toList() return?
- how to create a remote session EJB from a client
- How to convert a List into a comma separated string without iterating List explicitly [duplicate]
- LOAD and CACHE application-scoped data with @Singleton and @Stateless
- EJB’s – when to use Remote and/or local interfaces?
- Initialize final variable before constructor in Java
- std::vector to java.util.Vector code generation with swig
- What’s the difference between unbounded wildcard type List and raw type List?
- Performance and Memory allocation comparison between List and Set