21. What is the diamond problem in C++ inheritance? A. A situation where the derived class cannot override the base class method B. A situation where the base class cannot be inherited by more than one derived class C. A situation where ambiguity arises due to multiple inheritance chains D. A situation where ambiguity arises due to lack of inheritance Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
22. In C++, which access specifier allows the members of a base class to be accessible in the derived class and its derived classes, but not from outside the class hierarchy? A. public B. private C. friend D. protected Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
23. What is the default access specifier for a base class when inheriting in C++? A. private B. public C. protected D. friend Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
24. In C++, what happens if a derived class inherits multiple base classes and each base class contains a member with the same name? A. The member of the derived class must explicitly specify which base class member to access B. The member of the derived class will access the member from the base class with the same name C. A compilation error occurs D. The member of the derived class accesses all members with the same name from all base classes Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
25. Which keyword is used to prevent a class from being inherited in C++? A. final B. sealed C. prevent_inheritance D. noinherit Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option A No explanation is given for this question Let's Discuss on Board
26. In C++, what is the process of creating a new class using an existing class as a blueprint and adding new functionalities to it? A. Derivation B. Composition C. Inheritance D. Polymorphism Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
27. What is the term used to describe a class that inherits from another class in C++? A. Base class B. Child class C. Parent class D. Derived class Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option D No explanation is given for this question Let's Discuss on Board
28. In C++, what happens if a derived class redefines a method that is already defined in its base class? A. Method in the base class overrides the derived class method B. Both methods are available for use C. Method in the derived class overrides the base class method D. A compilation error occurs Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board
29. In C++, which type of inheritance involves a class inheriting from multiple classes directly or indirectly? A. Hierarchical inheritance B. Multiple inheritance C. Multilevel inheritance D. None of the above Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option B No explanation is given for this question Let's Discuss on Board
30. What is the name given to the process of creating a new class by inheriting properties and behaviors from an existing class in C++? A. Polymorphism B. Encapsulation C. Inheritance D. Composition Answer & Solution Discuss in Board Save for Later Answer & Solution Answer: Option C No explanation is given for this question Let's Discuss on Board