Oracle
1Z0-809 · Question #164
1Z0-809 Question #164: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #164. The question stem and answer options stay visible for context.
Question
Given the code fragments:
interface Exportable {
void export();
}
class Tool implements Exportable {
public void export() {
System.out.println("Tool::export");
}
}
class ReportTool extends Tool implements Exportable {
public void export() {
System.out.println("RTool::export"); // line n1
}
public static void main(String[] args) {
Tool atool = new ReportTool();
Tool btool = new Tool();
Exportable ctool;
callExport(btool);
}
public static void callExport(Exportable ex) {
ex.export(); // line n2
}
}
What is the result?
Options
- ACompilation fails at both line n1 and line n2.
- BCompilation fails only at line n1.
- CCompilation fails only at line n2.
- DToo1 :: export Too1 :: export
- ERToo1 :: export Too1 :: export
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.