C++ Constructors Question:
Download Questions PDF

Which of the following statement is incorrect?

A. Constructor is a member function of the class.
B. The compiler always provides a zero argument constructor.
C. It is necessary that a constructor in a class should always be public.
D. Both B and C.

C++ Constructors Interview Question
C++ Constructors Interview Question

Answer:

Option D
Both B and C.

Download C++ Constructors Interview Questions And Answers PDF

Previous QuestionNext Question
Which of the following statement is correct?

A. Constructor has the same name as that of the class.
B. Destructor has the same name as that of the class with a tilde symbol at the beginning.
C. Both A and B.
D. Destructor has the same name as the first member function of the class.
When are the Global objects destroyed?

A. When the control comes out of the block in which they are being used.
B. When the program terminates.
C. When the control comes out of the function in which they are being used.
D. As soon as local objects die.