示例#1
0
        static void Main(string[] args)
        {
            son s = new son();

            Console.WriteLine(s.hello());
            //////////////////////////////////
            grandfather g = new son();

            Console.WriteLine(g.hello());
        }
示例#2
0
        static void Main(string[] args)
        {
            son s = new son();

            Console.WriteLine(s.hello()); // call Son.hello()
            //////////////////////////////////
            grandfather g = s;

            Console.WriteLine(g.hello()); // call Grandfather.hello()
            Console.WriteLine(g.GetType());
        }