Computer Science - Object Oriented Programming Using C++ - Discussion

6. 

The return type you code for all constructors is _____

[A]. void
[B]. the class type
[C]. the same type as the first data member defined in the class
[D]. no type

Answer: Option D

Explanation:

No answer description available for this question.

Sathya said: (Mar 9, 2011)  
Because the constructor have same name as class.

Shivkumar Napit said: (Sep 6, 2011)  
Because constructor are only used to create memory of objects,When any object is called.

Shrikant said: (Jun 17, 2012)  
Because constructors are only to allocate memory to the objects and initialize them. They do not return any value of reference to those objects.

Yousif said: (Nov 26, 2020)  
Please explain about the answer in detail.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.