O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required