Question: try { BufferedReader infile = new BufferedReader(new FileReader(filename)); // i1 int x = Integer.parseInt(infile.readLine( )); // i2 a[++i] = (double) (1 / x); //i3 }
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
2-1) An exception raised by the instruction in i1 would be caught by the catch statement labeled ________ A) e1
B) e2 C) e5 D) either e1 or e5 E) either e1, e4, or e5
2-2) 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
2-3) A finally clause will execute ____________ A) only if the try statement that precedes it does not throw an exception B) only if the try statement that precedes it throws an exception that is caught C) only if the try statement that precedes it throws an exception that is not caught D) only if the try statement that precedes it throws an exception, whether it is caught or not E) in any circumstance
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
