Exemplo n.º 1
0
        static void Main(string[] args)
        {
            Animal cat = new Cat("Pesho", "Whiskas");
            Animal dog = new Dog("Gosho", "Meat");

            Console.WriteLine(cat.ExplainSelf());
            Console.WriteLine(dog.ExplainSelf());
        }
Exemplo n.º 2
0
        public static void Main()
        {
            string name          = Console.ReadLine();
            string favouriteFood = Console.ReadLine();
            var    cat           = new Cat(name, favouriteFood);

            name          = Console.ReadLine();
            favouriteFood = Console.ReadLine();
            var dog = new Dog(name, favouriteFood);

            Console.WriteLine(cat.ExplainSelf());
            Console.WriteLine(dog.ExplainSelf());
        }