Practice mode Java

How many classes can a Java class directly extend?

Correct answer D. One at most

Explanation

Java permits single inheritance of classes, so a class has exactly one direct superclass, and Object is used implicitly when no extends clause is written. Only Object itself has none. Multiple inheritance of type is achieved through interfaces, since a class may implement any number of them while still extending just one class.

Report a problem

Answer checked How we write and check questions

Tip: press A, B, C or D to answer, and N for the next question.

Advertisement

Have a question about this answer?

Your email address will not be published. Required fields are marked *

Links and website addresses are not allowed in comments.