No built-in int[] to List
The following creates a List<int[]> as if int[] were int[][]
Arrays.asList(int[])
Must:
Arrays.asList(int[])
Must:
int[] ints = new int[] {1,2,3};
final ArrayList<Integer> list =
new ArrayList<Integer>(ints.length);
for (final int i : ints) {
list.add(ints[i]); //autoboxing
}
return Collections.unmodifiableList(list);
Comments