日期:2014-05-17 浏览次数:20945 次
public class d : System.ICloneable
{
public class d : System.ICloneable
{
public d(int ii) : base()
{
i = ii;
Console.WriteLine("ctor");
}
~d() { Console.WriteLine("dtor"); }
public Object Clone()
{
return new d(i);
}
public int i;
}
class Program
{
static void Main(string[] args)
{
d d1 = new d(12);
d d2 = d1;
d2.i = 13;
Console.WriteLine(d1.i);
}
}
d ctor
13
d dtor
Press any key to continue . . .