Chapter 15. Inheritance and Polymorphism

In this chapter I expand on the concept of inheritance. Although you have been using inheritance since the first chapter of this book, I haven't said much about it. In this chapter you learn the details of inheritance that are necessary to use it properly in your own programs. In this chapter you will learn the following:

  • What inheritance is

  • How inheritance simplifies program code

  • What base classes and derived classes are

  • What the protected access specifier is

  • What polymorphism is

  • How polymorphism can simplify your programs

As you read this chapter, keep in mind that inheritance was added to OOP languages to make the programmer's life easier. While the end user may not see any advantages to inheritance and polymorphism, you will have a greater appreciation of how much simpler they can make program code.

Get Beginning C# 3.0 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.