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