🎴 Flashcard Mode

Java Applets and AWT Graphics

Card1 / 12
Mastered0
Review0
QuestionClick to flip

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.

AnswerClick to flip back
A
```java
catch (ArrayIndexOutOfBoundsException aie) {
aie.printStackTrace();
System.out.println("array size is less than what you are trying to access")
}
💡 Explanation:

Catch routines are defined in this form. 

Change Mode