Nitish kumar

Nitish kumar

  • NA
  • 31
  • 17.9k

Difference between shallow and deep Object Copying?

Nov 20 2012 5:02 AM
When using .NET, two types of copies are possible: shallow and deep. In the case of a shallow copy, a new object is created and each member from the original object is assigned to the corresponding member of the new object. A deep copy is when a copy is created that contains none of the original data. A true copy of each member is created. A deep copy doesn't need to do anything special with members that are value types. But for reference data types, the new object must reference copies of that data instead of the original data.

Answers (1)