-->

What is virtual constructors/destructors?

Virtual Destructor : - The explicit destroying of object with the use of delete operator to a base c…

What are shallow and deep copy?

- A shallow copy just copies the values of the data as they are. Even if there is a pointer that po…

How should a contructor handle a failure?

- If construction fails at the runtime, it throws an exception. - Constructor does not have return t…

What is a virtual destructor? Explain the use of it.

- If the destructor in the base class is not made virtual, then an object that might have been decl…

Difference between a copy constructor and an assignment operator.

- Copy constructor creates a new object which has the copy of the original object . - On the other h…

Order in which constructors are called when an object of a derived class is created

Explain the order in which constructors are called when an object of a derived class is created. - T…

What are the restrictions apply to constructors and destructors?

The following restrictions apply to constructors and destructors : - Constructors and destructors do…

What are destructors?

Destructors are complements of constructors. When an object is destroyed, its destructor is automat…

What is a constructor?

Constructors allow initialization of objects at the time of their creation. Constructor function is…