Skip to main content

Posts

Showing posts with the label Copy constructo

Copy Constructor

C# doesn't have Copy constructor like C++. Instead it provides ICloneable interface which has Clone method. Class that supports the idea of copy constructor should implement ICloneable interface and then implement Clone method either using Shallow Copy (??) calling MemberwiseClone or Deep copy (??) i.e hand coping all members. Shallow Copy Deep Copy