C++ Inheritance & Polymorphism: Pure Virtual Functions & Abstract Classes
C++
| Intermediate
- 10 videos | 1h 21m 54s
- Includes Assessment
- Earns a Badge
Pure virtual functions and interfaces are very powerful tools in object-oriented programming, and interface-driven programming is a great way of splitting up work across different developers on a large project. You will start this course by considering why your destructors should be marked as virtual in the base class if you have an inheritance hierarchy. You'll see the harmful effects of not using virtual destructors in an inheritance hierarchy and the problems with object slicing. You will also learn why it is preferable to have variables of reference types to the base class rather than the value types. You will then move to some finer points of working with virtual methods, such as, the inadvisability of using default parameters because these are statically bound. Finally, you will master the syntax and semantics of pure virtual functions and learn how a class that contains even one pure virtual function becomes an abstract class that cannot be instantiated directly.
WHAT YOU WILL LEARN
-
Discover the key concepts covered in this courseEnable runtime polymorphism by marking destructors as virtualIdentify scenarios in which object slicing can occurRecall that default input arguments should not be specified in virtual functionsRecognize how virtual methods invoked from constructors and destructors are statically dispatched
-
Use the scope resolution operator to invoke specific versions of virtual methodsDefine and invoke pure virtual functionsOutline the concept of abstract classesCreate pure abstract classes in c++Summarize the key concepts covered in this course
IN THIS COURSE
-
2m 10s
-
11m 30s
-
11m 17s
-
9m 29s
-
8m 34s
-
8m 41s
-
10m 5s
-
7m 46s
-
9m 39s
-
2m 42s
EARN A DIGITAL BADGE WHEN YOU COMPLETE THIS COURSE
Skillsoft is providing you the opportunity to earn a digital badge upon successful completion on some of our courses, which can be shared on any social network or business platform.
Digital badges are yours to keep, forever.