Multiple Choice
Use the code below to answer the following questions. Note that the catch statements in the code are not implemented, but you will not need those details. Assume filename is a String, x is an int, a is a double array and i is an int. Use the comments i1, i2, i3, e1, e2, e3, e4, e5 to answer the questions (i for instruction, e for exception handler) .
try
{
BufferedReader infile = new BufferedReader(new FileReader(filename) ) ; // i1
int x = Integer.parseInt(infile.readLine( ) ) ; // i2
a[++i] = (double) (1 / x) ; // i3
}
catch (FileNotFoundException ex) {...} // e1
catch (NumberFormatException ex) {...} // e2
catch (ArithmeticException ex) {...} // e3
catch (ArrayIndexOutOfBounds ex) {...} // e4
catch (IOException ex) {...} // e5
-An exception raised by the instruction in i2 would be caught by the catch statement labeled
A) e1
B) e2
C) e3
D) e5
E) either e2 or e5
Correct Answer:

Verified
Correct Answer:
Verified
Q12: A combo box generates an item event
Q14: Assume Exceptionname is a checked exception. If
Q14: Write a set of code that will
Q15: What is a mnemonic?<br> What are they
Q18: For the questions below, use the following
Q19: System.err is a(n)<br>A) input stream<br>B) GUI dialog
Q20: All run-time Errors throw Exceptions.
Q21: A Swing tool tip is<br>A) a mechanism
Q22: For the questions below, use the following
Q33: A processing stream is a data stream