Here you can find the source of arrayIndexOf(Object[] array, Object element)
public static int arrayIndexOf(Object[] array, Object element)
//package com.java2s; /*/* w w w. j a v a2 s .co m*/ SongScribe song notation program Copyright (C) 2006 Csaba Kavai This file is part of SongScribe. SongScribe is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version. SongScribe is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. Created on Aug 6, 2006 */ public class Main { public static int arrayIndexOf(Object[] array, Object element) { for (int i = 0; i < array.length; i++) { if (element.equals(array[i])) { return i; } } return -1; } }