title: How to find the index of an element in an int array?
body: <p>How can I find an index of a certain value in a Java array of type <code>int</code>?</p>
  
  <p>I tried using <code>Arrays.binarySearch</code> on my unsorted array, it only sometimes gives the correct answer.</p>