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 |
what is the order of initialization for data?
10 Answers Amazon, TCS, Wipro,
How are the features of c++ different from c?
How many keywords are used in c++?
Why should you learn c++?
What is the use of typedef?
Do we have private destructors?
What is a loop? What are different types of loops in c++?
What are virtual functions and what is its use?
What is encapsulation in c++ with example?
Give a very good method to count the number of ones in a "n" (e.g. 32) bit number.
What is an Object/Instance?
What is the output of the following 3D Array int arr[3][2][2]={1,2,3,4,5,6,7,8,9,10,11,12}; what is the output for arr[2][1][0]?
6 Answers HCL, Integra, IPMC, ORG,