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

Constructors And Destructors

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

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

Cpp Programming Quiz 256 – A function with the same name as the class, but preceded with a tilde character (~) is called __________ of that class. Read More »

Constructors And Destructors, Cpp Programming

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

Question: Which of the following statement is correct?
[A].
A constructor of a derived class can access any public and protected member of the base class.
[B].

Constructor cannot be inherited but the derived class can call them.
[C].

A constructor of a derived class cannot access any public and protected member of the base class.
[D].

Both A and B. 

Answer: Option D

Explanation:

No answer description available for this question.

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

Constructors And Destructors, Cpp Programming

Cpp Programming Quiz 258 – Constructors __________ to allow different approaches of object construction.

Question: Constructors __________ to allow different approaches of object construction.
[A].
cannot overloaded
[B].

can be overloaded
[C].

can be called
[D].

can be nested 

Answer: Option B

Explanation:

No answer description available for this question.

Cpp Programming Quiz 258 – Constructors __________ to allow different approaches of object construction. Read More »

Constructors And Destructors, Cpp Programming

Cpp Programming Quiz 259 – Which of the following statement is correct about destructors?

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

Cpp Programming Quiz 259 – Which of the following statement is correct about destructors? Read More »

Constructors And Destructors, Cpp Programming

Cpp Programming Quiz 260 – Which of the following statement is correct about constructors?

Question: Which of the following statement is correct about constructors?
[A].
A constructor has a return type.
[B].

A constructor cannot contain a function call.
[C].

A constructor has no return type.
[D].

A constructor has a void return type. 

Answer: Option C

Explanation:

No answer description available for this question.

Cpp Programming Quiz 260 – Which of the following statement is correct about constructors? Read More »

Constructors And Destructors, Cpp Programming

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

Question: Which of the following statement is correct?
[A].
A destructor has the same name as the class in which it is present.
[B].

A destructor has a different name than the class in which it is present.
[C].

A destructor always returns an integer.
[D].

A destructor can be overloaded. 

Answer: Option A

Explanation:

No answer description available for this question.

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

Constructors And Destructors, Cpp Programming

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

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

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

Constructors And Destructors, Cpp Programming

Cpp Programming Quiz 263 – Which of the following gets called when an object goes out of scope?

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

Cpp Programming Quiz 263 – Which of the following gets called when an object goes out of scope? Read More »

Constructors And Destructors, Cpp Programming

Cpp Programming Quiz 264 – Which of the following gets called when an object is being created?

Question: Which of the following gets called when an object is being created?
[A].
constructor
[B].

virtual function
[C].

destructor
[D].

main 

Answer: Option A

Explanation:

No answer description available for this question.

Cpp Programming Quiz 264 – Which of the following gets called when an object is being created? Read More »

Constructors And Destructors, Cpp Programming