title: Index of an element in an array using Java
body: <p>The following code in Java return -1. I thought that it should return 3.</p>
  
  <pre><code>int[] array = {1,2,3,4,5,6}; 
  System.out.println(Arrays.asList(array).indexOf(4));
  </code></pre>
  
  <p>Can you help me understand how this function works.</p>
  
  <p>Thanks</p>