コード例 #1
0
        //Classic sample of Polymorphism 4
        // Accessing Base Class Virtual Members from Derived Classes
        // A derived class that has replaced or overridden a method or property
        // can still access the method or property on the base class using the base keyword.
        public static void ScenarioSeven()
        {
            StupidTeacher B = new StupidTeacher();

            B.Dance();  // Calls the old method.



            // Keep the console open in debug mode.
            Console.WriteLine("Press any key to exit.");
            Console.ReadKey();
        }