public static void Main(string[] args) { Animal animal = new Animal(); animal.Greet(); Dog dog = new Dog(); dog.Greet(); }
static void Main(string[] args) { Animal animal = new Animal(); animal.Greet(); Dog dog = new Dog(); dog.Greet(); Console.ReadLine(); }
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(); }