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.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access