C Sharp (C#) - Polymorphism and Abstract Classes
What will be the output of the following code?
abstract class Animal {
public abstract string Speak();
}
class Dog : Animal {
public override string Speak() {
return "Woof";
}
}
class Program {
static void Main() {
Animal myDog = new Dog();
System.Console.WriteLine(myDog.Speak());
}
}