你不能使用通用数组创建。这是Java泛型的缺陷/功能。
没有警告的方式是:
- 使用列表列表而不是列表数组:
List< List<IntegerNode>> nodeLists = new linkedList< List< IntegerNode >>();
- 声明列表数组的特殊类:
class IntegerNodeList { private final List< IntegerNode > nodes;}
你不能使用通用数组创建。这是Java泛型的缺陷/功能。
没有警告的方式是:
List< List<IntegerNode>> nodeLists = new linkedList< List< IntegerNode >>();
class IntegerNodeList { private final List< IntegerNode > nodes;}