Possible Duplicate:
C#: Passing null to overloaded method - which method is called?
Here is a test case
object a = null;
var b = Convert.ToString (null);
var c = Convert.ToString (a);
string d = Convert.ToString (null); // CLR chooses Convert.ToString(string value)
string e = Convert.ToString (a); // CLR chooses Convert.ToString(object value)
The question is why CLR decides that null is interpreted as string in first case? It appears that this question was already answered here
Here is another similar case. None of these ifs are triggered
object x = null;
if (x is object)
{
Console.Write ("x is object");
}
if (x is string)
{
Console.Write ("x is string");
}
if (null is object)
{
Console.Write ("null is object");
}
if (null is string)
{
Console.Write ("null is string");
}