public static int indexOf ( final int [ ] array , final int object ) { for ( int i = 0 ; i < array . length ; ++ i ) { if ( array [ i ] == object ) // FOUND return i ; } return - 1 ; }
This method is used to find a number in an array .