Multiple choice

Identify the type of inheritance used in the following C++ code snippet.

class A { }; class B:public A { }; class C:public A { }; class D:public A { };

  1. Multiple inheritance

  2. Single or simple inheritance

  3. Hierarchical inheritance

  4. Multilevel inheritance

  5. None of the above

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

Given code snippet contains single base class (A) nd three derived classes(B,C,D) from base class (A). It depicts hierarchical inheritance where a single base class is inherited by two or more derived classes. This option is true.