Java Applets and AWT Graphics

Casual Mode - Take your time!

1 / 12
Correct
0
Incorrect
0
Score
0%
Multiple Choice

In the following Java program, it was found that these statements have generated an exception of Array Index out of bound Exception.

int b[ ] = {10,20,30};
b[50] = 100 ;

Choose the correct catch statement for the above code.

  1. ```java
    catch (ArrayIndexOutOfBoundsException aie) {
    aie.printStackTrace();
    System.out.println("array size is less than what you are trying to access")
    }
  2. java catch (ArrayIndexOutOfBoundsException aie) { System.out.println("array size is less than what you are trying to access") }
  3. ```java
    catch (aie) {
    aie.printStackTrace();
    System.out.println("array size is less than what you are trying to access")
    }
  4. ```java
    throw (ArrayIndexOutOfBoundsException aie) {
    aie.printStackTrace();
    System.out.println(array size is less than what you are trying to access ')
    }
  5. ```java
    throw (aie) {
    aie.printStackTrace();
    System.out.println(array size is less than what you are trying to access)
    }
Change Mode