1.

When is the constructor called for an object?(a) As soon as overloading is required(b) As soon as class is derived(c) As soon as class is created(d) As soon as object is createdThis question was posed to me during an internship interview.My question comes from Overloading Constructors topic in section Constructors and Destructors of Object Oriented Programming

Answer»

The CORRECT option is (d) As SOON as OBJECT is created

Explanation: The CONSTRUCTOR is called as soon as the object is created. The overloading COMES into picture as to identify which constructor have to be called depending on arguments passed in the creation of object.



Discussion

No Comment Found

Related InterviewSolutions