posted 14 years ago
In fact, when you do i.asList(), it returns a list of int[] (List<int[]>) with one element :/
like [{ 1, 2, 3, 4, 5, 6, 7, 8, 9 }]
so, there is no element at index 4 ; there is only an element at index 0, which is your original int[].
the asList method considers that you want to build a list from one int[], which IS an object. It is like if you were doing Arrays.asList(i1, i2, i3, i4), where i1 i2 i3 and i4 are int[] objects.