MCQs on Object Oriented C++ Programming
MCQs on Object Oriented C++ Programming
MCQ related to Object Oriented programming using C++ for general use and also for job preparation of Public Service Commission
MCQ related to Object Oriented programming using C++ for general use and also for job preparation of Public Service Commission
Q No.1 of 10
Class Dog : public X, public Y
is an example of
is an example of
Option 1
|
Multiple inheritance
|
Option 2
|
Repeated inheritance
|
Option 3
|
Linear inheritance
|
Option 4
|
None of the above
|
Q No.2 of 10
Choose the correct statements.
Option 1
|
A destructor is not inherited
|
Option 2
|
A constructor cannot be called explicitly
|
Option 3
|
A constructor is not inherited
|
Option 4
|
All of these
|
Q No.3 of 10
The compiler identifies a virtual function to be pure
Option 1
|
by the presence of the keyword pure
|
Option 2
|
by its location in the program
|
Option 3
|
if it is equated to 0
|
Option 4
|
none of the above
|
Q No.4 of 10
Let class APE be a friend of class SAPIEN. Let class HUMAN be a child class of SAPIEN and let MONKEY be a child class of APE. Then
Option 1
|
SAPIEN is not a friend of APE
|
Option 2
|
APE is not a friend of HUMAN
|
Option 3
|
MONKEY is not afriend of SAPIEN
|
Option 4
|
All of these
|
Q No.5 of 10
A class having no name
Option 1
|
cannot have a constructor
|
Option 2
|
cannot have a destructor
|
Option 3
|
cannot be passed as an argument
|
Option 4
|
all of these
|
Q No.6 of 10
For a method to be an interface between the outside world and a class, it had to be declard
Option 1
|
private
|
Option 2
|
protected
|
Option 3
|
public
|
Option 4
|
external
|
Q No.7 of 10
Choose the correct statement(s) from the following.
Option 1
|
In a struct, the access control is public by default.
|
Option 2
|
In a struct, the access control is private by default.
|
Option 3
|
In a class, the access control is public by default.
|
Option 4
|
None of these
|
Q No.8 of 10
Overloading is otherwise called as
Option 1
|
Virtual polymorphism
|
Option 2
|
Transient polymorphism
|
Option 3
|
Pseudo polymorphism
|
Option 4
|
Ad-hoc polymorphism
|
Q No.9 of 10
C++ encourages structuring a software as a collection of components that are
Option 1
|
Highly cohesive and loosely coupled
|
Option 2
|
Not highly cohesive but loosely coupled
|
Option 3
|
Highly cohesive and tightly coupled
|
Option 4
|
Not highly cohesive but tightly coupled
|
Q No.10 of 10
Which of the follwing parameter passing mechanism(s) is /are supported by C++, but not by C?
Option 1
|
Pass by value
|
Option 2
|
Pass by reference
|
Option 3
|
Pass by value-result
|
Option 4
|
All of the above
|