Why does this produce \"0\" ?
object a = 0; object b = a; a = null; Console.WriteLine(b.ToString()); // Produces \"0\" Console.Read();
Does
A picture is worth a thousand words:
Setting a = null removes a's reference to the object (the boxed integer 0). It does not affect the object itself. b still references the unchanged object afterwards.
a = null
a
0
b