Question: 1 -
When the inheritance is private, the private methods in base class are __________ in the derived class.
-
Public
-
Inaccessible
-
Protected
-
Accessible
Answer:
Inaccessible
Solution:
When the inheritance is private, the private methods in base class are inaccessible in the derived class
When the inheritance is private, the private methods in base class are inaccessible in the derived class
Question: 2 -
Inheritance allow in C++ Program?
-
Class Re-usability
-
Creating a hierarchy of classes
-
All of the above
-
Extendibility
Answer:
All of the above
Solution not available.
Question: 3 -
What is meant by multiple inheritance?
-
Deriving a derived class from more than one base class
-
Deriving a base class from derived class
-
None of the mentioned
-
Deriving a derived class from base class
Answer:
Deriving a derived class from more than one base class
Solution not available.
Question: 4 -
What will be the order of execution of base class constructors in the following method of inheritance.class a: public b, public c {...};
-
c(); b(); a();
-
b(); a(); c();
-
a(); b(); c();
-
b(); c(); a();
Answer:
b(); c(); a();
Solution not available.
Question: 5 -
Which design patterns benefit from the multiple inheritances?
-
Adapter and observer pattern
-
Code pattern
-
None of the mentioned
-
Glue pattern
Answer:
Adapter and observer pattern
Solution:
A template is a formula for creating a generic class
A template is a formula for creating a generic class