C++ Inheritance & Polymorphism: Pure Virtual Functions & Abstract Classes

C++ 20    |    Intermediate
  • 10 Videos | 1h 21m 54s
  • 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 course
    enable runtime polymorphism by marking destructors as virtual
    identify scenarios in which object slicing can occur
    recall that default input arguments should not be specified in virtual functions
    recognize how virtual methods invoked from constructors and destructors are statically dispatched
  • use the scope resolution operator to invoke specific versions of virtual methods
    define and invoke pure virtual functions
    outline the concept of abstract classes
    create pure abstract classes in C++
    summarize the key concepts covered in this course

IN THIS COURSE

  • Playable
    1. 
    Course Overview
    2m 10s
    UP NEXT
  • Playable
    2. 
    Using Virtual Destructors
    11m 30s
  • Locked
    3. 
    Understanding Object Slicing
    11m 17s
  • Locked
    4. 
    Exploring Default Arguments to Virtual Functions
    9m 29s
  • Locked
    5. 
    Using Virtual Methods in Constructors & Destructors
    8m 34s
  • Locked
    6. 
    Exploring the '::' Operator
    8m 41s
  • Locked
    7. 
    Using Pure Virtual Functions
    10m 5s
  • Locked
    8. 
    Exploring Abstract Classes
    7m 46s
  • Locked
    9. 
    Using Interfaces
    9m 39s
  • Locked
    10. 
    Course Summary
    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 of this course, which can be shared on any social network or business platform

Digital badges are yours to keep, forever.