예제 #1
0
        static void Main(string[] args)
        {
            var robot = new Dog { Greeting = "Bark Bark", Activity = "Relax" };
            robot.MixSay();
            robot.MixAct();

            var builder = new Human { Greeting = "Hello", Activity = "Hardworking"};
            builder.MixSay();
            builder.MixAct();

            Console.ReadKey();
        }
예제 #2
0
        static void Main(string[] args)
        {
            try
            {
                Dog dog = new Dog();
                Dog labrador = new Labrador();

                dog.Feed();
                labrador.Feed();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            Console.ReadKey();
        }
예제 #3
0
 public void Feed(Dog dog)
 {
     Console.WriteLine("{0} feeds {1}", name, dog.name);
 }