📌  相关文章
📜  site:stackoverflow.com 列表是抽象的;无法实例化 public List<Integer>结果 = 新列表&lt;&gt;(); - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:35.789000             🧑  作者: Mango

代码示例1
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 mylist = new ArrayList();

-source: stackoverflow.com