nerdexam
Oracle

1Z0-809 · Question #164

Given the code fragments: interface Exportable { void export(); } class Tool implements Exportable { public void export() { System.out.println("Tool::export"); } } class ReportTool extends Tool…

The correct answer is B. Compilation fails only at line n1. You've hit your session limit · resets 10:20pm (America/New_York)

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

How the community answered

(32 responses)
  • A
    6% (2)
  • B
    81% (26)
  • C
    9% (3)
  • D
    3% (1)

Explanation

You've hit your session limit · resets 10:20pm (America/New_York)

Community Discussion

No community discussion yet for this question.

Full 1Z0-809 Practice