【发布时间】:2009-11-20 14:46:07
【问题描述】:
这给了我一个错误:
int[] l = new int[] {0, 2, 192, -1, 3, 9, 2, 2};
int[] l2 = new int[] {9001, 7, 21, 4, -3, 11, 10, 10};
int[] l3 = new int[] {5, 5, 5, 64, 21, 12, 13, 200};
Set<List<Integer>> lists = new HashSet<List<Integer>>();
lists.add(Arrays.asList(l));
Eclipse:
Set<List<Integer>>类型中的方法add(List<Integer>)不适用于参数 (List<int[]>)
我认为int 应该自动装箱为Integer?
【问题讨论】:
-
哦,伙计,您将集合对象命名为列表!
标签: java generics types autoboxing