Multiple choice

How many types of inheritance are there?

  1. 4

  2. 5

  3. 3

  4. 6

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The commonly cited types of inheritance in C++ are: single, multiple, multilevel, hierarchical, and hybrid (or virtual). This makes 5 main categories. Single involves one base class, multiple involves multiple base classes, multilevel involves chains of inheritance, hierarchical involves one base class with multiple derived classes, and hybrid combines different forms. Some textbooks may use slightly different terminology or categorizations.