int j =0;
MessageBox.Show(j.ToString());
MessageBox.Show(Convert.ToString(j));
We can convert the integer “j” using “j.ToString()” or “Convert.ToString” so what’s the difference.
The basic difference between them is Convert.ToString() return string.Empty in case of null object while “j.ToString()”
ToString() raise exception when the object is null
No comments:
Post a Comment