static void Main(string[] args) { MyDerivedClass derived = new MyDerivedClass(); MyBaseClass mybc = (MyBaseClass)derived; // Cast to base class derived.Print(); // Call Print from derived portion. mybc.Print(); // Call Print from base portion. }
static void Main(string[] args) { MyDerivedClass derived = new MyDerivedClass(); MyBaseClass mybc = (MyBaseClass)derived; // Cast to base class derived.Print(); mybc.Print(); }