1.

Write any four differences between Constructor and Destructor function with respect to object oriented programming.

Answer»
ConstructorDestructor
Name of the constructor function is same as that of className of the destructor function is same as that of class preceded by ~
Constructor functions are called automatically at the time of creation of the objectDestructor functions are called automatically when the scope of the object gets over
Constructor can be overloadedDestructor can not be overloaded
Constructor is used to initialize the data members of the classDestructor is used to deinitialize the data members of the class



Discussion

No Comment Found

Related InterviewSolutions