C Sharp (C#) - Inheritance
What will be the output of the following code?
class Parent {
public virtual void Display() { Console.WriteLine("Parent"); }
}
class Child : Parent {
public sealed override void Display() { Console.WriteLine("Child"); }
}
class GrandChild : Child {
public override void Display() { Console.WriteLine("GrandChild"); }
}
Parent obj = new GrandChild();
obj.Display();