public static < T > int indexOf ( T [ ] array , T element ) { for ( int i = 0 ; i < array . length ; i ++ ) { if ( array [ i ] . equals ( element ) ) { return i ; } } return - 1 ; }
Return the position of an element inside an array