Utilizing Dynamic Binding through Polymorphism
This chapter will further extend our knowledge of object-oriented programming in C++. We will begin by introducing a powerful OO concept, polymorphism, and then understand how this idea is implemented in C++ through direct language support. We will implement polymorphism using virtual functions in hierarchies of related classes, and understand how we can achieve runtime binding of a specific derived class method to a more generic, base class operation. We will understand how the OO concept of polymorphism presented in this chapter will support versatile and robust designs and easily extensible code in C++.
In this chapter, we will cover the following main topics:
- Understanding the OO concept of polymorphism and why it is important to OOP
- Defining virtual functions, understanding how virtual functions override base class methods (or halt the overriding process with the
final
specifier), generalizing derived class objects...