📚 Practice Mode
Java Applets and AWT Graphics
Learn at your own pace with hints and detailed explanations
1 / 12
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.
- ```java
catch (ArrayIndexOutOfBoundsException aie) {
aie.printStackTrace();
System.out.println("array size is less than what you are trying to access")
} java catch (ArrayIndexOutOfBoundsException aie) { System.out.println("array size is less than what you are trying to access") }- ```java
catch (aie) {
aie.printStackTrace();
System.out.println("array size is less than what you are trying to access")
} - ```java
throw (ArrayIndexOutOfBoundsException aie) {
aie.printStackTrace();
System.out.println(array size is less than what you are trying to access ')
} - ```java
throw (aie) {
aie.printStackTrace();
System.out.println(array size is less than what you are trying to access)
}