Inheritance

Inheritance is an object-oriented term relating to how one class, a derived class, can share the characteristics and behavior from another class, a base class. There should be a natural parent/child relationship between the base class and the derived class, respectively. This can be thought of as an “is a” relationship, because the derived class can be identified by both its class type and its base class type. Essentially, any base class members with protected or greater access also belong to a derived class.

The benefits gained by this are the ability to reuse the base class members and also to add members to the derived class. The derived class then becomes a specialization of the parent. This specialization can continue for as ...

Get C# Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.