예제 #1
0
파일: Program.cs 프로젝트: nuritus/Lesson3
        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());
        }