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); }
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()); }
static void MakeSound(Poodle p) { Console.WriteLine(p.MakeSound()); }