Derived Class Constructors

Regardless of their access modifiers, the constructors of a base class are never inherited by the derived class. Despite this fact, they can still be called from the constructors of the derived class and, in certain cases, the compiler will implicitly provide the necessary call back to a base class constructor. After all, a part of the derived class is from the base class, so the base class constructors are highly suited to initialize the base class part of the derived class.

Note

Like their constructor siblings, destructors are not inherited by the derived class.

Recall from Chapter 13, “Class Anatomy Part II: Object ...

Get C# Primer Plus now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.