Search code examples
c#.neticloneable

ICloneable question


If a class implemented ICloneable, what does that mean?


Solution

  • That is has the IClonable.Clone method. The documentation says that the method is intended to clone objects. The documentation notes specifically that the clone can be either deep or shallow. It is also noted the the resulting type must be of the same type as the object that is cloned, but there is no guarantee in the type system that it actually is so.

    To sum it up, it does not offer much hard promises, but the intent is to create independent clones.