131k views
5 votes
In an inheritance relationship __________. a. the subclass constructor always executes before the superclass constructor b. the superclass constructor always executes before the subclass constructor c. the constructor with the lowest overhead always executes first regardless of inheritance in subclasses d. the unified constructor always executes first regardless of inheritance

User Rossanmol
by
4.9k points

1 Answer

1 vote

Answer:

The correct answer is option b. "the superclass constructor always executes before the subclass constructor".

Step-by-step explanation:

An inheritance relationship is a concept applied to describe the creation of subclasses from one or more superclasses. In inheritance relationships the superclass constructor always executes before the subclass constructor. An inheritance relationship is the contrary of an invoking object method, at which a subclass could override the superclass and could be executed first.

User Muneeb Ejaz
by
5.1k points