예제 #1
0
        static void Main(string[] args)
        {
            Dog d = new Dog("riki", "meat");

            Console.WriteLine(d);
            d.MakeSound();
            Horse h = new Horse("meni", true);

            Console.WriteLine(h);
            Horse j = new Horse("jack", false);

            Console.WriteLine(j);
            j.MakeSound();
            Horse y = new Horse("fin", true);

            Console.WriteLine(y);
            Horse r = new Horse("luke", true);

            Console.WriteLine(r);
            Poodle p = new Poodle("lucky", "bones", "two");

            Console.WriteLine(p);
            p.MakeSound();
            Wolf w = new Wolf("richie", "rabbit", "moonrunners");

            Console.WriteLine(w);
            w.MakeSound();
            PetWolf q = new PetWolf("jack", "fish", "skyyellers");

            Console.WriteLine(q);
            q.MakeSound();
            Console.WriteLine("-------------------------------");
            Horse[] horses = { h, j, y, r };
            GetRacingHorses(horses);
        }
예제 #2
0
        static void Main(string[] args)
        {
            Dog d = new Dog("riki", "meat");

            Console.WriteLine(d);
            Console.WriteLine(d.MakeSound());
            Horse h = new Horse("meni", true);

            Console.WriteLine(h);
            Console.WriteLine(h.MakeSound());
            Poodle p = new Poodle("lucky", "bones", "two");

            Console.WriteLine(p);
            Console.WriteLine(p.MakeSound());
            Wolf w = new Wolf("richie", "rabbit", "moonrunners");

            Console.WriteLine(w);
            Console.WriteLine(w.MakeSound());
            PetWolf q = new PetWolf("jack", "fish", "skyyellers");

            Console.WriteLine(q);
            Console.WriteLine(q.MakeSound());
        }
예제 #3
0
 static void MakeSound(Poodle p)
 {
     Console.WriteLine(p.MakeSound());
 }