Arrays.asList()
takes a arbitrary number of arguments of given type T
(#asList(T.. t)
). Calling Arrays.asList(arrs)
what you really do is passing single element of type int[]
hence the problem.
It should be either:
int[] arrs = {1,2,4,3,5,6};
List<int[]> arry = Arrays.asList(arrs);
or
List<Integer> arry = Arrays.asList(1,2,3,4,5,6);