Hi,
I even read the related parts of language specification
but could not find anything that explains the following:
=============== =====
public class A {
public void Foo(object o) {
System.Console. WriteLine("Foo( object o)");
}
public void Foo(string s) {
System.Console. WriteLine("Foo( string s)");
}
public static void Main() {
A a = new A();
a.Foo(null);
}
}
=============== ====
I expect to get ("Foo(object o)" but this prints ("Foo
(string s)"). Can anybody explain why? Which part of the
language specification explains this behavior?
Thanks,
Hamza GOLYERI
I even read the related parts of language specification
but could not find anything that explains the following:
=============== =====
public class A {
public void Foo(object o) {
System.Console. WriteLine("Foo( object o)");
}
public void Foo(string s) {
System.Console. WriteLine("Foo( string s)");
}
public static void Main() {
A a = new A();
a.Foo(null);
}
}
=============== ====
I expect to get ("Foo(object o)" but this prints ("Foo
(string s)"). Can anybody explain why? Which part of the
language specification explains this behavior?
Thanks,
Hamza GOLYERI
Comment