What is the use of IClonable interface in .NET?

后端 未结 5 1591
时光说笑
时光说笑 2020-12-20 15:34

I just wanted to know what is the use of IClonable interface in .NET?

5条回答
  •  [愿得一人]
    2020-12-20 15:42

    Create copy of specified object.

    ICloneable Interface:

    Supports cloning, which creates a new instance of a class with the same value as an existing instance.

    EDIT: Scott Chamberlain absolutely right. This interface doesn't specified either this copy should be deep or shallow. And this is one of the most confusing thing about this interface.

提交回复
热议问题