using System; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { var v = new Derived(); int x = 18; v.Foo(x); } } public class Base { public virtual void Foo(int x) { Console.WriteLine("In Base.foo"); } } public class Derived : Base { public override void Foo(int x) { Console.WriteLine("In Derived.Foo(int x)"); } public void Foo(object o) { Console.WriteLine("In Foo(object o)"); } } } |