Types of Inheritance – MCQs July 22, 2025 by u930973931_answers 30 Score: 0 Attempted: 0/30 Subscribe 1. : What is inheritance in C++? (A) Reusing code by calling main function (B) Reusing existing class features in a new class (C) Using a loop in a program (D) Accessing private members of a class 2. : What is the class that inherits from another class called? (A) Parent class (B) Base class (C) Child class (D) Outer class 3. : What is the class being inherited from called? (A) Child class (B) Derived class (C) Base class (D) Outer class 4. : Which type of inheritance involves a class inheriting from more than one base class? (A) Single (B) Multilevel (C) Hierarchical (D) Multiple 5. : Which inheritance type involves a class inheriting from a class which is already a derived class? (A) Multilevel (B) Multiple (C) Hybrid (D) Hierarchical 6. : What is hierarchical inheritance? (A) One base class with many derived classes (B) Many base classes with one derived class (C) A class inheriting itself (D) A class using friend functions 7. : Which of the following is not a type of inheritance in C++? (A) Multiple (B) Multilevel (C) Repeated (D) Hierarchical 8. : What is hybrid inheritance? (A) Combining all classes into one (B) Inheriting a single base class (C) A combination of two or more types of inheritance (D) None of the above 9. : Which inheritance type can cause the “Diamond Problem”? (A) Single (B) Multiple (C) Hierarchical (D) Multilevel 10. : What keyword is used to define inheritance in C++? (A) derives (B) inherit (C) base (D) public/private/protected 11. : In which type of inheritance can ambiguity occur without virtual inheritance? (A) Single (B) Multiple (C) Hybrid (D) Hierarchical 12. : Which access specifier allows derived classes to access base class members but restricts access from outside classes? (A) public (B) private (C) protected (D) internal 13. : In private inheritance, public members of base class become what in derived class? (A) private (B) public (C) protected (D) static 14. : Which inheritance mode keeps the base class’s public members accessible as public in the derived class? (A) private (B) public (C) protected (D) virtual 15. : Which type of inheritance is easiest to implement and understand? (A) Multiple (B) Multilevel (C) Single (D) Hybrid 16. : In multilevel inheritance, how many classes are involved at minimum? (A) 1 (B) 2 (C) 3 (D) 4 17. : What is one major benefit of inheritance in C++? (A) Fast execution (B) Easier syntax (C) Code reusability (D) Increased memory 18. : Which inheritance type allows a class to derive from both A and B, where A and B both derive from a common class C? (A) Multilevel (B) Multiple (C) Hybrid (D) Hierarchical 19. : In C++, which inheritance type helps simulate real-world hierarchy? (A) Single (B) Hierarchical (C) Multilevel (D) Multiple 20. : In multiple inheritance, how many base classes can a derived class have? (A) Only one (B) Two (C) As many as needed (D) None 21. : What does the ‘virtual’ keyword help prevent in inheritance? (A) Runtime errors (B) Compilation errors (C) Ambiguity from diamond problem (D) Access violations 22. : What happens if two base classes have a member with the same name and are inherited? (A) The derived class inherits both without issue (B) Ambiguity occurs (C) The compiler auto resolves (D) Only one member is inherited 23. : In hybrid inheritance, what is a possible consequence? (A) Code efficiency (B) Compile time speed-up (C) Ambiguity and complexity (D) Better readability 24. : Which of the following is a valid inheritance declaration in C++? (A) class B inherits A; (B) class B : public A; (D) class A is B; 25. : What does inheritance allow in terms of functionality? (A) Access to only private data (B) Access to all system-level libraries (C) Reuse and extend existing class functionality (D) Rewrite existing class functions 26. : What type of inheritance will occur if a class inherits two base classes and those base classes inherit the same class? (A) Single (B) Hybrid (C) Multiple (D) Multilevel 27. : In which inheritance type is the concept of ‘grandparent’ class applicable? (A) Single (B) Hierarchical (C) Multilevel (D) Multiple 28. : Which of these is a valid type of C++ inheritance? (A) Cyclic (B) Layered (C) Multilevel (D) Compositional 29. : When is inheritance most useful? (A) When writing input/output code (B) When extending the functionality of existing classes (C) When defining only variables (D) When debugging code 30. : What is a major disadvantage of multiple inheritance? (A) Simple syntax (B) Virtual function usage (C) Diamond problem (D) Better performance