예제 #1
0
파일: Program.cs 프로젝트: kthanu/Tutorial
        static void Main(string[] args)
        {
            Animal animalObj = new Animal();

            animalObj.MakeSound();

            Dog dogObj = new Dog();

            dogObj.MakeSound();
            dogObj.DoTricks();

            Animal dog = new Dog();

            dog.MakeSound();
            //Dog wholeDog = (Cat)dog;
            //wholeDog.PatTheCat();

            Cat catObj = new Cat();

            catObj.MakeSound();

            Animal cat = new Cat();

            cat.MakeSound();

            Console.ReadKey();
        }