Why is the output B5, can someone explain?
class A
{
public virtual void M(int x=5)
Console.Write("A"+x);
}
class B:A
{
public override void M(int x=6)
Console.Write("B"+x);
}
class Program
{
static void Main(string[] args)
{
A a = new B();
a.M();
}
}
//Output is : B5
I expect the output to be B6, but the actual output is B5.