Simplified guide of MCQs for Exams, Interviews

Sub Topic: C++

1 .  expression x.y represents as

  • A. member x of object y
  • B. member y of object x
  • C. member y of object pointed by x
  • D. All

Correct Answer:

member y of object x


2 .  Can constructors be overloaded?

  • A. Yes
  • B. No

Correct Answer:

Yes


3 .  When overloading unary operators using Friend function,it requires_____ argument

  • A. Zero
  • B. One
  • C. Two
  • D. None

Correct Answer:

One


4 .  In CPP program, Can we declare and define a user defined function inside a struct as we do in a class ?

  • A. Yes
  • B. No

Correct Answer:

Yes


5 .  ____________ refers to the act of representing only essential features without including the background details.

  • A. Data Hiding
  • B. Data Encapsulation
  • C. Data Abstraction
  • D. All of these

Correct Answer:

Data Abstraction


6 .  Runtime polymorphism is achieved only when a virtual function is accessed through a pointer to the base class.

  • A. True
  • B. False

Correct Answer:

True


7 .  Find the wrong statement about Abstract Class.

  • A. We can’t create its objects
  • B. We can’t create pointers to an abstract class.
  • C. It contains at least one pure virtual function
  • D. We can create references to an abstract class.

Correct Answer:

We can’t create pointers to an abstract class.


8 .  Assigning one or more function body to the same name is called ____________ .

  • A. Function Overriding
  • B. Function Overloading
  • C. All
  • D. None

Correct Answer:

Function Overloading


9 .  A function can be declared as friend maximum only in two classes

  • A. True
  • B. False

Correct Answer:

False


10 .  Which of the following statements are not true about destructor?

  • A. It is invoked when object goes out of the scope
  • B. Like constructor it can also have parameters
  • C. It can be virtual

Correct Answer:

Like constructor it can also have parameters