Monday, October 3, 2016

Shallow copy and Deep copy in C#

Shallow copy and Deep copy: Shallow Copy :Shallow copy copies the reference of that class or object and its don't create new memory to copy the object. Example: public MyClass ShallowCopy()     {         return (MyClass)this.MemberwiseClone();     } /////////////////////////////////////////////////////////////////////////  class A     {  ...