Sunday, 8 September 2013

Why autoboxing does not occur in this context?

Why autoboxing does not occur in this context?

I would like to know why autoboxing does not occur in the following:
int [] array = new int[]{1,3,6,2,-1,6};// if it had been Integer instead
of int, would have worked.
List<Integer> liston = Arrays.asList(array);
Is there any particular reason why it does not autobox automatically?
Thanks in advance.

No comments:

Post a Comment