Answer is E.
To test:
interface Downloadable {
public void download();
}
interface Readable extends Downloadable { // line n1
public void readBook ();
}
abstract class Book implements Readable { // line n2
public void readBook() {
System.out.println("Read Book");
}
}
class EBook extends Book { // line n3
public void readBook() {
System.out.println("Read E-Book");
}
//public void download() {} // It is necessary to implement the download() method in this class to compile.
}
public class Test {
public static void main (String [] args) {
Book book1 = new EBook();
book1.readBook();
}
}
The answer is letter E:
n1 -> Correct, one interface extends another interface.
n2 -> Correct, a class implements an interface and to remove the obligation to rewrite all interface methods, you must put the keyword "abstract" before "class".
n3 -> Wrong, like E-book and extends Book which implements the readable interface which extends another Downloadable interface, it inherits the "download()" method and because it is an interface, the E-book class needs to overload the method to compile or do like its parent Book class, put the keyword "abstract" before "class".
This section is not available anymore. Please use the main Exam Page.1z0-808 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
DJava
Highly Voted 6 years agorasifer
Highly Voted 6 years agoMPignaProTech
Most Recent 9 months agocarloswork
2 years, 8 months agoiSnover
2 years, 9 months agoEmilioDeBaku
4 years agoronen
4 years, 7 months ago