C++ Programming - Constructors and Destructors

Exercise :: Constructors and Destructors - General Questions

11. 

A function with the same name as the class, but preceded with a tilde character (~) is called __________ of that class.

A. constructor
B. destructor
C. function
D. object

Answer: Option B

Explanation:

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

12. 

A union that has no constructor can be initialized with another union of __________ type.

A. different
B. same
C. virtual
D. class

Answer: Option B

Explanation:

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

13. 

Which of the following gets called when an object goes out of scope?

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

Answer: Option B

Explanation:

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

14. 

Which of the following statement is correct?

A. Destructor destroys only integer data members of the object.
B. Destructor destroys only float data members of the object.
C. Destructor destroys only pointer data members of the object.
D. Destructor destroys the complete object.

Answer: Option D

Explanation:

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

15. 

__________ used to make a copy of one class object from another class object of the same class type.

A. constructor
B. copy constructor
C. destructor
D. default constructor

Answer: Option B

Explanation:

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