Exemple #1
0
        public static void Main(string[] args)
        {
            Animal animal = new Animal();

            animal.Greet();
            Dog dog = new Dog();

            dog.Greet();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            Animal animal = new Animal();

            animal.Greet();
            Dog dog = new Dog();

            dog.Greet();

            Console.ReadLine();
        }
Exemple #3
0
        static void Main(string[] args)
        {
            Animal a1 = new Animal();

            a1.Talk();
            a1.Sing();
            a1.Greet();
            Animal a2 = new Dog(); // Object of type Animal which references to object of type Dog

            a2.Talk();
            a2.Sing();
            a2.Greet();
            Console.ReadLine();
        }