Answer:
It will throw an error which says that 'Object reference not set to an instance of an object'
Because if the object is null or not assigned any value to it and we are trying to convert it with .ToString then it will throw an error.Because .ToString does not handle Null value.Thats why it will throw an error.
So to avoid such exception,we have to use Convert.ToString() method as it handles Null value.
Asked In: Many Interviews |
Alert Moderator