1.

Which among the following is false for a constructor?(a) Constructors doesn’t have a return value(b) Constructors are always user defined(c) Constructors are overloaded with different signature(d) Constructors may or may not have any arguments being acceptedThis question was addressed to me during an interview for a job.The origin of the question is Overloading Constructors topic in portion Constructors and Destructors of Object Oriented Programming

Answer»

Right answer is (B) Constructors are always USER defined

For explanation: The constructors are not always user defined. The construct will be PROVIDED implicitly from the compiler if the USED doesn’t defined any constructor. The implicit constructor MAKES all the string values null and allocates memory space for each data member.



Discussion

No Comment Found

Related InterviewSolutions