asked 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

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.

answered
User Muneeb Ejaz
by
8.0k points
Welcome to Qamnty — a place to ask, share, and grow together. Join our community and get real answers from real people.