static void Main(string[] args) { DerivedType dt = new DerivedType(); DerivedType d2 = dt.Clone() as DerivedType; //clone return the base type var d3 = dt.Clone(); //clone return the base type Console.WriteLine(d2); Console.WriteLine(d3); if (d2 is null) { Console.WriteLine("d2 is null"); } Console.ReadKey(); }
public object Clone() { DerivedType dt = new DerivedType(this); return(dt); }
private DerivedType(DerivedType right) : base(right) { _Value = right._Value.Clone() as double[]; }