Java compiler takes care of casting primitive data types and their wrapper classes..But my doubt is that although java compiler performs type casting all by itself, why is it that it prints an error when I try to convert an Array to ArrayList with int array as parameter..Like:
int[] val = {1,2,3,4,5};
ArrayList<Integer> newval = new ArrayList<Integer>(Arrays.asList(val));
Error: no suitable constructor found for
ArrayList(List<int[]>)
Why is the compiler not casting int to Integer?