C++ Inheritance & Polymorphism: Understanding & Using Polymorphism
C++ 20
| Intermediate
- 15 Videos | 2h 3m 57s
- Includes Assessment
- Earns a Badge
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.
WHAT YOU WILL LEARN
-
discover the key concepts covered in this courseoutline the concept of name hidingdemonstrate ways of getting around name hidingrecognize scenarios in which static binding is dangerouscontrast compile time and runtime polymorphismexplore the mechanics of runtime polymorphismdemonstrate how to use the virtual keywordenable runtime polymorphism using the ‘virtual’ keyword
-
demonstrate the use of runtime polymorphism in different scenariosidentify the costs associated with runtime polymorphismrecall that the signatures of dynamically dispatched methods must be the samedemonstrate the covariance edge case in dynamic method dispatchoutline the use of the override specificationdisable overriding and inheritance using the ‘final’ keywordsummarize the key concepts covered in this course
IN THIS COURSE
-
1.Course Overview1m 35sUP NEXT
-
2.Understanding Name Hiding10m 44s
-
3.Exploring Finer Points of Name Hiding9m 26s
-
4.Understanding How Static Binding Can Be Dangerous11m 35s
-
5.Polymorphism9m 36s
-
6.Mechanics of Polymorphism5m 43s
-
7.Introducing the 'virtual' Keyword9m 46s
-
8.Exploring Runtime Polymorphism7m 53s
-
9.Using Runtime Polymorphism with References9m 34s
-
10.Viewing Resources Used in Dynamic Method Dispatch5m 55s
-
11.Exploring Problems Related to Runtime Polymorphism9m 32s
-
12.Understanding Covariance10m 39s
-
13.Understanding the 'override' Specification7m 48s
-
14.Using the 'final' Keyword10m 13s
-
15.Course Summary3m 57s
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion of this course, which can be shared on any social network or business platform
Digital badges are yours to keep, forever.