static void Main(string[] args) { int x = 10; Debug.Assert(x > 10); DerivedClass derivedClass = new DerivedClass(); DerivedClass derivedClass2 = derivedClass.Clone() as DerivedClass; Console.ReadKey(); }
static void Main(string[] args) { DerivedClass AClass = new DerivedClass(); AClass.a = 1; AClass.b = 2; AClass.c = 3; DerivedClass BClass = AClass.Clone() as DerivedClass; BClass.new1 = 4; BClass.new2 = 5; Console.WriteLine(BClass.ToString()); }