The following code in Java return -1. I thought that it should return 3.

```
int[] array = {1,2,3,4,5,6}; 
System.out.println(Arrays.asList(array).indexOf(4));

```

Can you help me understand how this function works.

Thanks