C++ Language Multiple Choice Questions and Answers - 1

Question: 1

When a class object goes out of scope, the function that gets executed is ____

(A) Constructor

(B) Destructor

(C) Friend

(D) Inline

Ans: B

Destructor

Question: 2

Which is executed automatically when the control reaches the end of the class scope?

(A) Constructor

(B) Destructor

(C) Overloading

(D) Copy constructor

Ans: B

Destructor

Question: 3

The special character related to destructor is ___

(A) +

(B) !

(C) ?

(D) ~

Ans: D

~

Question: 4

The constructor without any parameter is called as ___

(A) Initial constructor

(B) Parameterized constructor

(C) Default constructor

(D) Instance parameter

Ans: B

Parameterized constructor

Question: 5

The constructor defined by the computers in the absence of user defined constructor is ____

(A) Copy

(B) Abstract

(C) Default

(D) Destructor

Ans: C

Default

Related Questions