Oracle
1Z0-809 · Question #156
1Z0-809 Question #156: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #156. The question stem and answer options stay visible for context.
Question
Given the code fragment:
public class Test {
void readCard(int cardNo) throws Exception {
System.out.println("Reading Card");
}
void checkCard(int cardNo) throws RuntimeException { // line n1
System.out.println("Checking Card");
}
public static void main(String[] args) {
Test ex = new Test();
int cardNo = 12344;
ex.checkCard(cardNo); // line n2
ex.readCard(cardNo); // line n3
}
}
What is the result?
Options
- ACompilation fails only at line n2.
- BCompilation fails at both line n2 and line n3.
- CCompilation fails only at line n3.
- DCompilation fails only at line n1.
- EReading Card
- FChecking Card
Unlock 1Z0-809 to see the answer
You've previewed enough free 1Z0-809 questions. Unlock 1Z0-809 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.