What is difference between shallow copy and deep copy? Which is default?
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 |
How does throwing and catching exceptions differ from using setjmp and longjmp?
Can I create my own functions in c++?
Is there a new/delete equivalent of realloc?
What are the characteristics of friend functions?
How to change constant values?
What is atoi?
What is type of 'this' pointer? Explain when it is get created?
Explain object slicing in c++?
Which is the best c++ software?
Can I run c program in turbo c++?
Why do we learn c++?
Define Virtual function in C++.