what is the difference between Convert.toString and .toString ()?

Just to give an understanding of what the above question means see the below code.
int i =0;
MessageBox.Show(i.ToString());
MessageBox.Show(Convert.ToString(i));
We can convert the integer “i” using “i.ToString()” or “Convert.ToString” so what is the
difference. The basic difference between them is “Convert” function handles NULLS while
“i.ToString()” does not it will throw a NULL reference exception error. So as a good coding
practice using “convert” is always safe.

1 comment:

  1. Great information you got here. I've been reading about this topic for one week now for my papers in school and thank God I found it here in your blog. I had a great time reading this.Web Hosting Solution

    ReplyDelete