1.
Can struct be used as Base class for inheritance?
(a) Yes
(b) No
2.
The derivation of Child class from Base class is indicated by ____ symbol.
(a) ::
(b) :
(c) ;
(d) |
class baseClass
{
// Implementaion here
};
class deriveClass: public baseClass
{
// Implementaion here
};
3.
Reusability of the code can be achieved in CPP through ______
(a) Polymorphism
(b) Encapsulation
(c) Inheritance
(d) Both a and c
4.
class X, class Y and class Z are derived from class BASE. This is ______ inheritance.
(a) Multiple
(b) Multilevel
(c) Hierarchical
(d) Single
5.
During a class inheritance in CPP, if the visibility mode or mode of derivation is not provided, then by default visibility mode is ___________.
(a) public
(b) protected
(c) private
(d) Friend
6.
In case of inheritance where both base and derived class are having constructors, when an object of derived class is created then___________ .
(a) constructor of derived class will be invoked first
(b) constructor of base class will be invoked first
(c) constructor of derived class will be executed first followed by base class
(d) constructor of base class will be executed first followed by derived class
7.
In Multipath inheritance, in order to remove duplicate set of records in child class, we ___________ .
(a) Write Virtual function in parent classes
(b) Write virtual functions is base class
(c) Make base class as virtual base class
(d) All of these
8.
When a base class is privately inherited by the derived class, then_____________
(a) protected members of the base class become private members of derived class
(b) public members of the base class become private members of derived class
(c) both a and b
(d) only b
9.
What is the syntax of inheritance of class?
(a) class name
(b) class name : access specifer
(c) class name : access specifer class
(d) None of the mentioned
10
How many types of inheritance are there in c++?
(a) 2
(b) 3
(c) 4
(d) 5