Multiple choice technology programming languages

A class inherit the constructors of its superclass?

  1. True

  2. False

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

Constructors are NOT inherited in Java. A subclass does not inherit constructors from its superclass. However, a subclass can call a superclass constructor using super() as its first statement. If no explicit constructor is defined in the subclass, the compiler generates a default no-arg constructor that calls super() implicitly.