using System;
// https://stackoverflow.com/questions/154112/c-sharp-potential-interview-question-too-hard
public class Program
{
public class A
public void Foo( int n )
Console.WriteLine( "A::Foo" );
}
public class B : A
/* note that A::Foo and B::Foo are not related at all */
public void Foo( double n )
Console.WriteLine( "B::Foo" );
public static void Main( string[] args )
B b = new B();
/* which Foo is chosen? */
b.Foo( 5 );
((A)b).Foo(5);
// result: B::Foo
// A::Foo