Sumeet Singh Sumeet Singh - 6 months ago 36
C# Question

Why explicitly call ToString() method in

I gather that
method accepts string argument and therefore we require
method to call on the argument.

object k = 999;

But when it comes to
, it is smart enough to do this by itself. My question is Why the difference?


If you have a look at,8c83114cc3fd109d

then you'll see that there are many overloads of the WriteLine function in the Console class, including Console.WriteLine(Object value). This is very convenient.

MessageBox.Show lacks these different overloads and excepts "only" a string.