Inheritance and Polymorphism
This chapter is a continuation of the previous two chapters, where we introduced how you can do OOP in C and reached the concepts of composition and aggregation. This chapter mainly continues the discussion regarding relationships between objects and their corresponding classes and covers inheritance and polymorphism. As part of this chapter, we conclude this topic and we continue with Abstraction in the following chapter.
This chapter is heavily dependent on the theory explained in the previous two chapters, where we were discussing the possible relationships between classes. We explained composition and aggregation relationships, and now we are going to talk about the extension or inheritance relationship in this chapter, along with a few other topics.
The following are the topics that will be explained throughout this chapter:
- As explained earlier, the inheritance relationship is the first topic that we discuss. The...