Why java does not autobox int[] to Integer[]
When I do the following, arrayList1 - contains one element and it is an int[] . arrayList2 - not compiling (Error : The constructor ArrayList<Integer>(List<int[]>) is undefined) arrayList3 - contains 7 elements and they are Integer objects Here's the code: int[] intArray = new int[]{2,3,4,5,6,7,8}; ArrayList arrayList1 = new ArrayList(Arrays.asList(intArray)); ArrayList<Integer> arrayList2 = new ArrayList<Integer>(Arrays.asList(intArray)); Integer[] integerArray = new Integer[]{2,3,4,5,6,7,8}; ArrayList<Integer> arrayList3 = new ArrayList<Integer>(Arrays.asList(integerArray)); Question : Why