Exemple #1
0
        public void Run()
        {
            horse   = new Horse();
            pig     = new Pig();
            chicken = new Chicken();
            sheep   = new Sheep();

            horse.Name();
            Console.WriteLine("I am a horse");
            horse.Speak();
            horse.Eat();
            horse.Sleep();


            Console.ReadKey();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Pig     Mike  = new Pig();
            Sheep   James = new Sheep();
            Chicken Bud   = new Chicken();
            Goat    Tom   = new Goat();

            Console.WriteLine("Welcom to Derrick's Farm!");
            Console.WriteLine("I would like to show you my aminals.");

            Mike.Talk();
            James.Talk();
            Bud.Talk();
            Tom.Talk();

            NewAnimal();
        }