public A {
//属性定义(省略了set get)
private int _num;
private string _text;
public A Clone(){
A copy = new A();
copy.Num = this._num;
copy.Text = this._text;
return copy;
}
}
public B : A{
//属性定义(省略了set get)
private int _count;
public B Clone(){
??????????? ///这部分怎么写才能以最好的结构实现,先做A.clone,然后再把B中的Count赋值
}
}
这个问题可以用代码一点一点写出来,但我觉得可以通过抽象或接口这种东西搞定,但现在不太熟,大家帮看看,谢谢