C++ Inheritance & Polymorphism: Understanding & Using Polymorphism

placeholder

Inheritance forms the basis for polymorphism specifically runtime polymorphism which is a powerful object-oriented programming construct. Runtime polymorphism involves a pointer or a reference of the base class type holding an object of the derived class. The beauty of runtime polymorphism is that when virtual methods are invoked on this pointer the derived class versions are executed. You will start this course by defining name hiding and how most methods on C++ objects are by default statically dispatched. You will then learn about polymorphism and dynamic dispatch which is accomplished using the virtual keyword. Finally you will learn how the ‘override’ and final specifications can be used to achieve precise semantics and reduce the scope of bugs and typos in your C++ programs.