1.

Which constructor is called while assigning some object with another?(a) Default(b) Parameterized(c) Copy(d) Direct assignment is usedThis question was posed to me during an online exam.My query is from Types of Constructors in section Constructors and Destructors of Object Oriented Programming

Answer»

Right CHOICE is (C) Copy

Easiest EXPLANATION - Copy constructor is used while an object is assigned with ANOTHER. This is mandatory since we can’t decide which member should be assigned to which member value. By using copy constructor, we can assign the values in REQUIRED form.



Discussion

No Comment Found

Related InterviewSolutions