java : Understanding Arrays.asList(T…array) method for primitive types
问题 I wrote following code and was surprised to see the output: Integer a = 211; int b = 211; int[] array = {210,211,212}; System.out.println(Arrays.asList(array).contains(a)); System.out.println(Arrays.asList(array).contains(b)); Output: false false I found this question and some other questions linked to it and learned that asList method doesn't Autobox stuffs. I checked the returned type in eclipse javadoc preview: I couldn't quite understand this return type. int[] is an object and not a