[JAVA] Arrays.asList (int []). Contains (int) doesn't work

I passed the array declared with int [] to Arrays.asList and contained it, but it didn't work as expected.

int[] array = {1, 2, 3, 4, 5};
Arrays.asList(array).contains(3)
-> false

I searched for various things, but I thought that I would declare the array with Integer [] instead of int [].

Integer[] array = {1, 2, 3, 4, 5};
Arrays.asList(array).contains(3)
-> true

Recommended Posts

Arrays.asList (int []). Contains (int) doesn't work
[gradle] pathingJar doesn't work if classpath contains spaces
The program doesn't work, the program doesn't stop ...
@ClassRules doesn't work with PowerMockRunner
ruby get.chomp.to_i doesn't work, doesn't load
[Beginner] When rails s doesn't work
When PyCall doesn't work with PyCall :: PythonNotFound