.NET interview question video :-what is the difference between convert.tostring and tostring functions ?

Posted by Questpond under .NET Framework category on | Points: 350 | Views : 5370
.NET interview question video :-what is the difference between convert.tostring and tostring functions ?
This is one of those famous .NET interview question which keeps coming up now and then. To answer precisely and shortly convert.tostring handles nulls while simple tostring() function does not handle null. Below video demonstrates the same practically.



Get Questpond videos on discounted price from ITFunda.com.

Comments or Responses

Posted by: Akiii on: 3/1/2011
The Convert.ToString() method simply returns a null if the input is null.

string result = Convert.ToString(myVariable);

but please let me know what does simply Tostring() do ?
Anybody ?

Thanks and Regards
Akiii
Posted by: Questpond on: 3/2/2011
as the video shows it throws a nullreference exception.

Posted by: Akiii on: 3/2/2011
thank you sir for your answer and response....

Akiii

Login to post response