ACtE03 · Chapter 3Programming & Applications🏛️ Past Licensure QuestionID: f3da65f4
Consider the following class declarations in C++:
C++class A { /* ... */ };
class B : public A { /* ... */ };
class C : public B { /* ... */ };
What type of inheritance is represented here?
Consider the following class declarations in C++:
C++
class A { /* ... */ };
class B : public A { /* ... */ };
class C : public B { /* ... */ };What type of inheritance is represented here?
Multiple Choice Options
- A
Multiple inheritance
- B✓ Correct Option
Multilevel inheritance
- C
Hierarchical inheritance
- D
Hybrid inheritance
Detailed Technical Solution & Explanation
When class B inherits from class A, and class C subsequently inherits from class B, forming a linear chain of derivations, this is known as Multilevel Inheritance.
Option Analysis:
•
Option A (Multiple inheritance): One class inheriting from multiple direct base classes simultaneously.
•
Option B (Multilevel inheritance): Correct. Linear chain of class derivation (A -> B -> C).
•
Option C (Hierarchical inheritance): Multiple classes deriving from a single parent.
•
Option D (Hybrid inheritance): Combination of two or more distinct inheritance models.
Reference: Demo2 · Set 1NEC Licensure Syllabus