C Sharp (C#) - Inheritance
What will be the output of this code?
class Base {
public virtual string Greet() => "Hello from Base";
}
class Derived : Base {
public override string Greet() => "Hello from Derived";
}
class Program {
static void Main() {
Base obj = new Derived();
System.Console.WriteLine(obj.Greet());
}
}