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
Explain about Virtual Function in C++?
What is this pointer in c++?
What is array give example?
What is guard code in c++?
Comment on c++ standard exceptions?
What is type of 'this' pointer? Explain when it is get created?
Can you Mention some Application of C/C++?
Can you pass an array to a function in c++?
Mention the ways in which parameterized can be invoked. Give an example of each.
What is a breakpoint?
Which is the best c++ compiler?
What's the most powerful programming language?
Difference between overloading vs. Overriding
can any one help to find a specific string between html tags
which is changed to a sting..
weather.html looks (for location) is
How do I run a program in notepad ++?