C++ Programming - Constructors and Destructors

Exercise :: Constructors and Destructors - General Questions

36. 

Which of the following gets called when an object is being created?

A. constructor
B. virtual function
C. destructor
D. main

Answer: Option A

Explanation:

No answer description available for this question. Let us discuss.

37. 

To ensure that every object in the array receives a destructor call, always delete memory allocated as an array with operator __________ .

A. destructor
B. delete
C. delete[]
D. kill[]
E. free[]

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

38. 

Which of the following statement is correct about constructors?

A. A constructor has a return type.
B. A constructor cannot contain a function call.
C. A constructor has no return type.
D. A constructor has a void return type.

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

39. 

Which of the following statement is correct whenever an object goes out of scope?

A. The default constructor of the object is called.
B. The parameterized destructor is called.
C. The default destructor of the object is called.
D. None of the above.

Answer: Option C

Explanation:

No answer description available for this question. Let us discuss.

« Prev   1 2 3 4 5 6 7 8