What type of inheritance is demonstrated by the following C++ code?

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

Options

  • A. Multiple inheritance
  • B. Hierarchical inheritance
  • C. Multilevel inheritance
  • D. More than one of the above
  • E. None of the above

Correct Answer (Detailed Explanation is Below)

C. Multilevel inheritance

Detailed Explanation

Correct Answer: Option C

Explanation:
Class B inherits from A, and class C inherits from B. This forms the chain A → B → C, which is called multilevel inheritance.