1.

Which among the following best describes constructor overloading?(a) Defining one constructor in each class of a program(b) Defining more than one constructor in single class(c) Defining more than one constructor in single class with different signature(d) Defining destructor with each constructorI got this question in a national level competition.Query is from Overloading Constructors topic in portion Constructors and Destructors of Object Oriented Programming

Answer»

Right answer is (c) DEFINING more than one constructor in single CLASS with different signature

For explanation: If more than one CONSTRUCTORS are DEFINED in a class with same signature, then that results in error. The signatures must be different. So that the constructors can be DIFFERENTIATED.



Discussion

No Comment Found

Related InterviewSolutions