Oracle
1Z0-809 · Question #165
Given: interface Downloadable { public void download(); } interface Readable extends Downloadable { public void readbook(); } abstract class Book implements Readable { public void readbook() {…
The correct answer is D. Compilation fails at line n3. You've hit your session limit · resets 10:20pm (America/New_York)
Question
Given:
interface Downloadable {
public void download();
}
interface Readable extends Downloadable {
public void readbook();
}
abstract class Book implements Readable {
public void readbook() {
System.out.println("Read Book"); // line n2
}
}
class EBook extends Book {
public void download() {
System.out.println("Read E-Book"); // line n3
}
}
And given the code fragment:
Book book1 = new EBook();
book1.readbook();
What is the result?
Options
- ACompilation fails at line n2.
- BRead E-Book
- CCompilation fails at line n1.
- DCompilation fails at line n3.
- ERead Book
How the community answered
(55 responses)- A11% (6)
- B4% (2)
- C2% (1)
- D78% (43)
- E5% (3)
Explanation
You've hit your session limit · resets 10:20pm (America/New_York)
Community Discussion
No community discussion yet for this question.