Missing Part of Question
An exception raised by the instruction in i3 would be caught by the catch statement labeled?
Answer:
e3 and e4.
Explanation:
The instruction tag i3 points to the following code segment
a[++i] = (double) (1 / x); // i3
The code segment above performs arithmetic operation (double)(1/x)
And then assigns the value of the arithmetic operations to an array element a[++I]
It's possible to have one or both of the following two exceptions.
1. Error in Arithmetic Operation
2. Index of Array out of bound
These are both represented in exception tags e3 and e4
catch (ArithmeticException ex) {...} // e3
catch (ArrayIndexOutOfBounds ex) {...} // e4
Exception e3 can arise when the program try to carry out invalid arithmetic operation.
For instance, 1/0 or 0/0.
This will lead to ArithmeticException to be thrown
Exception e4 can arise when the program tries to assign values to an index that's not in an array.
Say, the total index in a given array a is 5.
The index of this array is 0 to 4; i.e. a[0] to a[4]
The moment the program tries to assign values to array element other than the ones I listed above (e.g a[5]) ArrayIndexOutOfBounds exception will be thrown