Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by whitelisting our website.

Cpp Programming

Cpp Programming Quiz 231 – Destructor has the same name as the constructor and it is preceded by ______ .

Question: Destructor has the same name as the constructor and it is preceded by ______ .
[A].
!
[B].

?
[C].

~
[D].

Answer: Option C

Explanation:

No answer description available for this question.

Cpp Programming Quiz 231 – Destructor has the same name as the constructor and it is preceded by ______ . Read More »

Constructors And Destructors, Cpp Programming

Cpp Programming Quiz 232 – When are the Global objects destroyed?

Question: 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. 

Answer: Option B

Explanation:

No answer description available for this question.

Cpp Programming Quiz 232 – When are the Global objects destroyed? Read More »

Constructors And Destructors, Cpp Programming

Cpp Programming Quiz 233 – Which of the following statement is correct whenever an object goes out of scope?

Question: 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.

Cpp Programming Quiz 233 – Which of the following statement is correct whenever an object goes out of scope? Read More »

Constructors And Destructors, Cpp Programming

Cpp Programming Quiz 234 – How many times a constructor is called in the life-time of an object?

Question: How many times a constructor is called in the life-time of an object?
[A].
Only once
[B].

Twice
[C].

Thrice
[D].

Depends on the way of creation of object 

Answer: Option A

Explanation:

No answer description available for this question.

Cpp Programming Quiz 234 – How many times a constructor is called in the life-time of an object? Read More »

Constructors And Destructors, Cpp Programming

Cpp Programming Quiz 235 – Which of the following statement is incorrect?

Question: 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. 

Answer: Option D

Explanation:

No answer description available for this question.

Cpp Programming Quiz 235 – Which of the following statement is incorrect? Read More »

Constructors And Destructors, Cpp Programming

Cpp Programming Quiz 239 – Which of the following statement is correct?

Question: 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.

Cpp Programming Quiz 239 – Which of the following statement is correct? Read More »

Constructors And Destructors, Cpp Programming