Deep Copy with Array

前端 未结 4 999
孤街浪徒
孤街浪徒 2021-01-19 19:06

Why doesn\'t ICloneable\'s Clone method return a deep copy?

Here is some sample code:

class A : ICloneable 
{
    public int          


        
4条回答
  •  不要未来只要你来
    2021-01-19 19:54

    Array.Copy() does not use ICloneable. It simply copies values stored in each cell (which in this case are references to your A objects)

提交回复
热议问题