C++ Programming - Constructors and Destructors

Exercise :: Constructors and Destructors - General Questions

21. 

It is a __________ error to pass arguments to a destructor.

A. logical
B. virtual
C. syntax
D. linker

Answer: Option C

Explanation:

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

22. 

If the programmer does not explicitly provide a destructor, then which of the following creates an empty destructor?

A. Preprocessor
B. Compiler
C. Linker
D. main() function

Answer: Option B

Explanation:

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

23. 

A __________ is a constructor that either has no parameters, or if it has parameters, all the parameters have default values.

A. default constructor
B. copy constructor
C. Both A and B
D. None of these

Answer: Option A

Explanation:

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

24. 

How many default constructors per class are possible?

A. Only one
B. Two
C. Three
D. Unlimited

Answer: Option A

Explanation:

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

25. 

Which of the following statement is correct about destructors?

A. A destructor has void return type.
B. A destructor has integer return type.
C. A destructor has no return type.
D. A destructors return type is always same as that of main().

Answer: Option C

Explanation:

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