What is difference between shallow copy and deep copy? Which is default?
Answer Posted / hrpynux@gmail.com
Default version of clone method creates the shallow copy of an object. To create the deep copy of an object, you have to override clone method. Shallow copy is preferred if an object has only primitive fields. Deep copy is preferred if an object has references to other objects as fields.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Can a list of string be stored within a two dimensional array?
Difference between overloaded functions and overridden functions
Explain pass by value and pass by reference.
What is class invariant in c++?
Is c++ high level programming language?
Describe the process of creation and destruction of a derived class object?
What header file is needed for exit(); a) stdlib.h b) conio.h c) dos.h
How a new operator differs from the operator new?
If dog is a friend of boy and boy is a friend of house, is dog a friend of house?
Write about a nested class and mention its use?
What is double in c++?
What is a static element?
How much do coding jobs pay?
What is the use of data hiding?
How do I run c++?