Exemple #1
0
        static void Main(string[] args)
        {
            Puppy p = new Puppy();

            p.Eat();
            p.Bark();
            p.Weep();
            Console.ReadKey();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Animal cat   = new Animal();
            Dog    dog   = new Dog();
            Puppy  puppy = new Puppy();

            Console.WriteLine("Cat - just an animal");
            cat.Eat();

            Console.WriteLine("Dog");
            dog.Eat();
            dog.Bark();

            Console.WriteLine("Puppy");
            puppy.Eat();
            puppy.Bark();
            puppy.Weep();
        }