static void Main() { DerivedClass instance = new DerivedClass(); instance.Method(); // Delay. Console.ReadKey(); }
static void Main() { DerivedClass instance = new DerivedClass(); instance.Method(); // UpCast BaseClass instanceUp = instance as BaseClass; instanceUp.Method(); // DownCast DerivedClass instanceDown = instanceUp as DerivedClass; instanceDown.Method(); // Delay. Console.ReadKey(); }
static void Main(string[] args) { DerivedClass instace = new DerivedClass(); instace.Method(); }