Difference between Convert.ToString() and object.ToString()

 Posted by Rajni.Shekhar on 3/19/2012 | Category: ASP.NET Interview questions | Views: 4565 | Points: 40

object.ToString() give run time error if object value is null, whereas Convert.ToString(object) does not give any error in case of object value is null;

object obj=null;
string str=obj.ToTsirng(); //it will give run time error
string str1=Convert.ToString(obj); // it will run, not give any error

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response