首页 > 代码库 > Cannot instantiate the type List<Integer>

Cannot instantiate the type List<Integer>

在使用java.util.List; 的时候,把语句写成了:

List<Integer> arr = new List<Integer>();

导致错误:

Cannot instantiate the type List<Integer>

正确写法是:

List<Integer> arr = new ArrayList<Integer>();