Arrays.asList(int[]) will return List<int[]> , so the output is false .
The reason for this behavior is hidden in the signature of the Arrays.asList() method. it
public static <T> List<T> asList(T... a)
varargs, inside, is an array of objects (ot type T ). However, int[] does not meet this definition, therefore int[] considered as one separate object.
Meanwhile, Integer[] can be thought of as an array of objects of type T because it contains objects (but not primitives).
source share