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