I have taken two arrays in my below code snippet,
String[] things = {"a", "b", "c", "d", "e", "f"};
int[] a1 ={1,2,3,4,5};
System.out.println(Arrays.asList(things).contains("c"));
System.out.println(Arrays.asList(a1).contains(3));
and my outputs are
true false
I know when we use Arrays.asList we get an wrapper object which points to the existing array for random access, but in true sense an object of list interface is not created.
My question here is when the contains method works for string, why does it not work for int.