C++ Programming - Constructors and Destructors

Exercise :: Constructors and Destructors - General Questions

26. 

Which of the following statement is correct?

A. A constructor has the same name as the class in which it is present.
B. A constructor has a different name than the class in which it is present.
C. A constructor always returns an integer.
D. A constructor cannot be overloaded.

Answer: Option A

Explanation:

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

27. 

Which of the following implicitly creates a default constructor when the programmer does not explicitly define at least one constructor for a class?

A. Preprocessor
B. Linker
C. Loader
D. Compiler

Answer: Option D

Explanation:

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

28. 

A destructor takes __________ arguments.

A. one
B. two
C. three
D. no

Answer: Option D

Explanation:

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

29. 

Destructor calls are made in which order of the corresponding constructor calls?

A. Reverse order
B. Forward order
C. Depends on how the object is constructed
D. Depends on how many objects are constructed

Answer: Option A

Explanation:

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

30. 

Which of the following never requires any arguments?

A. Member function
B. Friend function
C. Default constructor
D. const function

Answer: Option C

Explanation:

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