nerdexam
Oracle

1Z0-804 · Question #146

Given: What is the result?

The correct answer is E. Compilation fails. The compilation fails at: interface Rideable { public String ride() { return "riding ";} Error due to: interface methods cannot have body.

Advanced Class Design

Question

Given:

What is the result?

Exhibit

1Z0-804 question #146 exhibit

Options

  • Ariding riding tolting
  • Briding riding cantering
  • Ctolting cantering tolting
  • Dtolting cantering cantering
  • ECompilation fails.
  • FAn exception is thrown at runtime.

How the community answered

(25 responses)
  • A
    8% (2)
  • C
    16% (4)
  • E
    72% (18)
  • F
    4% (1)

Explanation

The compilation fails at: interface Rideable { public String ride() { return "riding ";} Error due to: interface methods cannot have body.

Topics

#interface implementation#abstract methods#compilation error#polymorphism

Community Discussion

No community discussion yet for this question.

Full 1Z0-804 Practice