LogiQuest
Back to Inheritance
9

What is the output of the following program?

Base b = new Child();
Console.WriteLine(b.Name());
class Base { public string Name() => "base"; }
class Child : Base { public new string Name() => "child"; }
Medium

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.