Here you can find the source of arrayIndex(T[] arr, T item)
public static <T> int arrayIndex(T[] arr, T item)
//package com.java2s; public class Main { public static <T> int arrayIndex(T[] arr, T item) { if (arr == null) { return -1; }//from ww w . java 2 s .c om for (int i = 0; i < arr.length; i++) { if (arr[i].equals(item)) { return i; } } return -1; } }