c++ MCQ
c++ MCQ
1. Dennis Ritchie
2. Ken Thompson
3. Bjarne Stroustrup
4. Brian Kernighan
2) C++ follows ___.
1. Top-Down Design approach
2. Bottom-Up Design approach
3. Both of the above
4. None of the above.
3) ___________ is a instance of class
1. class
2. object
3. data member
4. member function
4) _____________ is a unit which binds the data member and its associated member
functions together.
1. class
2. object
3. data member
4. member function
5) Which of the following is not a type of Constructor in C++?
a) Default constructor
b) Parameterized constructor
c) Copy constructor
d) Friend constructor
6) Which allows you to create a derived class that inherits properties from more than one
base class?
a) Multilevel inheritance
b) Multiple inheritance
c) Hybrid Inheritance
d) Hierarchical Inheritance
7) Which feature in OOP allows reusing code?
a) Polymorphism
b) Inheritance
c) Encapsulation
d) Data hiding
8) Which of the following is used for implementing the late binding?
a) Operator Functions
b) Virtual Functions
c) Constant Functions
d) All of above
9) _________________ in C++ is defined as the wrapping up of data and information in a
single unit
a) Polymorphism
b) Inheritance
c) Encapsulation
d) Data hiding
10) Which of the following access specifier used in c++.
a)Private
b)public
c)protected
d) All of above
11) When one task is performed by different ways i.e. known as ____________
a) Polymorphism
b) Inheritance
c) Encapsulation
d) Data hiding
12) Hiding internal details and showing functionality is known as _____________
a) Polymorphism
b) Inheritance
c) Encapsulation
d) Abstraction
13) A ___________ is independent of any object of the class.
a) static member function
b) friend function
c) member function
d) none of these
14) A ___________ can access private and protected members of other classes in which it is
declared
a) Static class
b) Friend class
c) Private class
d) This class
15) The___________ operator is used to access and define the class properties outside the
class.
a) .
b) ::
c) :
d) ->
16) __________ is a keyword that refers to the current instance of the class.
a) Static
b) Friend
c) This
d) Const
17) _________ in C++ is a special method that is invoked automatically at the time of
object creation.
a) Member function
b) Static function
c) Constructor
d) Destructor
18) Destructor is an instance member function that is invoked automatically whenever an
object is going to be destroyed.
a) Member function
b) Static function
c) Constructor
d) Destructor
19) Which of the following operator cannot be overloaded?
a) ::
b) >
c) <
d) +
20) A __________ (also known as virtual methods) is a member function that is declared
within a base class and is re-defined (overridden) by a derived class.
a) Static function
b) Virtual function
c) Member function
d) Friend function
21) A class that contains pure virtual function is known as__________
a) Abstract class
b) Friend class
c) Static class
d) Public class
22) A virtual function which does not have function body and initialized with 0 is known as
___________
a) Virtual function
b) Pure virtual function
c) Static function
d) Friend function
23) ____________ is a property where two or more functions can share the name but
not the same list of arguments.
a) Functional Overloading
b) Function overriding
c) Operator overloading
d) None of these
24) C++ has the ability to provide the operators with a special meaning for a data type,
this ability is known as ________________.
a) Functional Overloading
b) Function overriding
c) Operator overloading
d) None of these
25) _____________ in C++ is a practice of connecting the function calls with the function
definitions by avoiding the issues with static binding.
a) Dynamic binding
b) Compile time Binding
c) Static binding
d) All of the above