Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

site:stackoverflow.com List is abstract; cannot be instantiated public List result = new List<>();

In Java, List is an interface. That is, it cannot be instantiated directly.

Instead you can use ArrayList which is an implementation of that interface 
that uses an array as its backing store (hence the name).

Since ArrayList is a kind of List, you can easily upcast it:

List<T> mylist = new ArrayList<T>();

-source: stackoverflow.com
 
PREVIOUS NEXT
Tagged: #List #instantiated #public #result
ADD COMMENT
Topic
Name
3+7 =