Multiple choice technology programming languages

10) Does a class inherit the constructors of its superclass?

  1. Using interface

  2. Class should be declared as private

  3. yes

  4. A class does not inherit constructors from any of its superclasses.

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

Constructors are not inherited in Java - each class must define its own constructors. A subclass can call a superclass constructor using super(), but this is explicit invocation, not inheritance. If you don't write any constructor, Java provides a default no-arg constructor that calls super().