Oracle
1Z0-819 · Question #161
1Z0-819 Question #161: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-819 to reveal the answer and full explanation for question #161. The question stem and answer options stay visible for context.
Question
import java.io.FileNotFoundException;
import java.io.IOException;
public class Tester {
public static void main(String[] args) {
doA();
//Line 1
}
private static void doA() throws IOException, IndexOutOfBoundsException {
if (false) {
throw new FileNotFoundException();
} else {
throw new IndexOutOfBoundsException();
}
}
}
What must be added in line 1 to compile this class?
Options
- Acatch(IOException e) {}
- Bcatch(FileNotFoundException |IndexOutOfBoundsException e) {}
- Ccatch(IndexOutOfBoundsException |IOException e) {}
- Dcatch(IndexOutOfBoundsException e) {} catch(FileNotFoundException e) {}
- Ecatch(IndexOutOfBoundsException e) {}catch(IndexOutOFBou dsException e) {}
Unlock 1Z0-819 to see the answer
You've previewed enough free 1Z0-819 questions. Unlock 1Z0-819 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.