我想知道为什么我得到堆栈溢出异常。我为学校作业创建了一个简单的纸牌游戏,当我克隆卡片返回它们时,我得到了堆栈溢出异常。 所以我得到这个卡类: public class Card : ICloneable
{
....
#region ICloneable Members
public object Clone()
{
return this
假设我有一个类A和B从A派生: class A : ICloneable
{
public object Clone() {...}
}
class B : A, ICloneable
{
public object Clone() {...}
}
这给 'B.Clone()' hides inherited member 'A.Clone()'. Use th
可能重复: Deep copy of List<T> public class MyClass : ICloneable
{
private List<string> m_list = new List<string>();
public MyClass()
{
List.Add("1111");
List.Add("2222");
我有以下几点: public class InstanceList : List<Instance> {}
我想使这个可复制的。这里继例如:Why no ICloneable<T>? 我试过如下: public interface ICloneable<T> : ICloneable Where T : ICloneable<T>
{ new T Clone(); }