C Sharp (C#) - Inheritance
Consider this code:
What will be the output and why?
class Base {
public virtual void Action() { Console.WriteLine("Base"); }
}
class Derived : Base {
public sealed override void Action() { Console.WriteLine("Derived"); }
}
class MoreDerived : Derived {
// No override here
}
Base obj = new MoreDerived();
obj.Action();What will be the output and why?
