C Sharp (C#) - Polymorphism and Abstract Classes
What will be the output of the following code?
class Base {
public virtual string GetMessage() => "Base";
}
class Derived : Base {
public override string GetMessage() => "Derived";
}
class Program {
static void Main() {
Base obj = new Derived();
System.Console.WriteLine(obj.GetMessage());
}
}