C++ Inheritance & Polymorphism: Multiple Inheritance & the Diamond Hierarchy

C++ 20    |    Expert
  • 11 Videos | 1h 21m 49s
  • Includes Assessment
  • Earns a Badge
C++ allows multiple inheritance, which means that one class can have more than one base. C++ also has some powerful mechanisms for dealing with edge cases such as the diamond hierarchy. You will start this course by learning the precise syntax which is required to implement multiple inheritance in C++, specifically, how it's important to have both base class access specifiers marked independently. You will then move on to the topic of a diamond inheritance hierarchy, in which the grandchild-level derived class has two parents, both of which inherit from the common, grandparent level base class. Finally, you will see how dynamic casts work in the context of an inheritance hierarchy, how these are a lot safer than static casts, and how they return a null value on failure when used with pointers but they throw an exception on failure when used with references.

WHAT YOU WILL LEARN

  • discover the key concepts covered in this course
    outline the concepts of multiple inheritance and the diamond hierarchy
    perform multiple inheritance and explore naming collisions
    use the ‘using’ keyword and implement virtual methods in multiple inheritance
    demonstrate the diamond hierarchy and virtual public inheritance
    perform C-style casts and recognize risks associated with them
  • use C++-style static casts and contrast them with C-style casts
    cast an object of one class to another class
    perform dynamic casts
    recognize errors and issues which can result with dynamic casts
    summarize the key concepts covered in this course

IN THIS COURSE

  • Playable
    1. 
    Course Overview
    1m 57s
    UP NEXT
  • Playable
    2. 
    Multiple Inheritance and Diamond Hierarchy Overview
    6m 27s
  • Locked
    3. 
    Understanding Multiple Inheritance
    8m 3s
  • Locked
    4. 
    Implementing Virtual Methods in Multiple Inheritance
    8m 38s
  • Locked
    5. 
    Creating a Diamond Inheritance Hierarchy
    11m 28s
  • Locked
    6. 
    Using C-style Casts in C++
    9m 57s
  • Locked
    7. 
    Performing Static Casts
    6m 15s
  • Locked
    8. 
    Casting Objects
    7m 54s
  • Locked
    9. 
    Performing Dynamic Casts
    7m 26s
  • Locked
    10. 
    Exploring Errors Related to Dynamic Casts
    10m 46s
  • Locked
    11. 
    Course Summary
    2m 56s

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.