Practice mode Java

Which call invokes a superclass constructor from inside a Java subclass constructor?

Correct answer B. super(...)

Explanation

An explicit constructor invocation of the form super(...) runs a constructor of the direct superclass, while this(...) calls another constructor of the same class. Java has no parent or base keyword for this purpose. If neither form is written, the compiler inserts super() automatically, which fails if the superclass has no accessible no-argument constructor.

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.