class Base
{
public virtual void MethodA(int x)
{
Console.WriteLine ("In Base Class");
}
}
class Derived : Base
{
public override void MethodA(int x)
{
Console.WriteLine ("In derived INT)");
}
public void MethodA(object o)
{
Console.WriteLine ("In derived OBJECT");
}
}
class Test
{
static void Main()
{
Derived d = new Derived();
int k = 20;
d.MethodA(k);
}
}
The oupt put I got for this is "In derived OBJECT". What is the reason for this strange behavior. After some search I got to know the reason being the signatures declared in base class are ignored. Why are they ignored?
Thanks,