using System;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
var a = new Derived();
int x = 123;
a.Foo(x);
}
}
public class Base
{
public virtual void Foo(int x)
{
Console.WriteLine("Base::Foo");
}
}
public class Derived : Base
{
public override void Foo(int x)
{
Console.WriteLine("Derived::Foo(int x)");
}
public void Foo(object o)
{
Console.WriteLine("Derived::Foo(object o)");
}
}
}
Результат: "Производный:: Foo (объект o)"
ПОЧЕМУ???