Summary

This chapter discussed basic inheritance concepts and how these are implemented in C#. The following are some of the important points that were covered.

Aggregation implements has a relationship, inheritance implements is a relationship.

Class hierarchies are formed after the same principles as those used by taxonomists. They move from the topmost general categories to the lowermost specialized categories.

Through inheritance, class members in general classes can be reused in specialized classes. Without inheritance, we have two options for creating objects that have unique as well as common class members. Write one class from which all the individual objects are instantiated, or write one class for each distinguishable type of objects. ...

Get C# Primer Plus 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.