Practice mode Java

What must a non-abstract Java class do when it implements an interface?

Correct answer D. Provide a body for every abstract method it inherits

Explanation

A concrete class may not be left with unimplemented abstract methods, so it must define them or inherit implementations from a superclass. Default methods can be used unchanged, and constants are inherited automatically. Interfaces have no constructors to call. A class that does not wish to implement everything must itself be declared abstract.

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.