class ArrayExcept {
    public static void main(String args[]) {
        int[] array = new int[5];  // z̐錾
        int index = (int) ( 10.0 * Math.random() );;
        
        try {
            array[index] = 10;
            System.out.println( "array["+index+"] = "+array[index] );
        }
        catch (ArrayIndexOutOfBoundsException e) {
            System.out.println( "ArrayOutOfBoundsException!" );
            System.out.println( "getMessage = "+e.getMessage() );
            System.out.println( "toString = "+e.toString() );
        }
        finally {
            System.out.println( "index = "+index );
        }
    }
} 
