C++ Inheritance & Polymorphism: Constructors, Destructors, & Inheritance
C++ 20
| Intermediate
- 11 videos | 1h 24m 2s
- Includes Assessment
- Earns a Badge
The order in which constructors and destructors are invoked on an object of a derived class in an inheritance hierarchy is a very important topic. Constructors are invoked in order from the top-most (most base-level) class, down to the most derived class. Destructors are invoked in the reverse order. Explore how constructors work in an inheritance hierarchy, the order in which the base and derived class constructors are invoked, and how initialization lists need to be used in the derived class. Discover how to use copy constructors and destructors in the context of inheritance. Learn how to set up an inheritance hierarchy for polymorphism. Finally, practice using objects in an inheritance hierarchy with variables of pointer and reference types. When you finish this course, you will have a solid foundation in constructors, destructors, and inheritance, setting the stage for runtime polymorphism and dynamic method dispatch.
WHAT YOU WILL LEARN
-
discover the key concepts covered in this coursecompare constructors in base classes and derived classesinvoke base class constructors from derived classesaccess base class fields from the child classrecall that constructors are not inheritedwork with copy constructors in inheritance hierarchies
-
work with destructors in inheritance hierarchiesset up an inheritance hierarchy for polymorphismcreate pointers to derived and base class objectscreate references to derived and base class objectssummarize the key concepts covered in this course
IN THIS COURSE
-
1.Course Overview1m 41sUP NEXT
-
2.Using Constructors in Inheritance Hierarchies7m 45s
-
3.Using Base Class Constructors in Child Classes10m 24s
-
4.Accessing Base Class Fields from the Child Class7m 14s
-
5.Using Base Class Constructors in Derived Classes8m 36s
-
6.Using Copy Constructors in Inheritance9m 13s
-
7.Using Destructors in Inheritance10m 7s
-
8.Setting up an Inheritance Hierarchy for Polymorphism9m 8s
-
9.Creating Pointers with Inheritance9m 27s
-
10.Creating References with Inheritance8m
-
11.Course Summary2m 26s
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.