What is deep copy
If an object has pointers to dynamically allocated memory, and the dynamically allocated memory needs to be copied when the original object is copied, then a deep copy is required.
What is shallow copy
A shallow copy of an object copies all of the member field values.
How constructor called in composition in the relationship of sub and main object
The constructor of sub object always calls first and then constructor of main object called.
How destructor called in composition in the relationship of sub and main object
The destructor of main object called always calls first and then destructor of sub object