omg you must be joking with this one :
> We can convert the integer "i" using
"i.ToString()" or
> "Convert.ToString" so what's 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 good coding practice using
"convert" is always safe.
The real difference is something else,
please take a look at the IML code of both options...
x.ToString(); is much more extensible code because the
ToString() is
declared virtual, in a OO world you want to use this one and
not the
static crap on the Convert class.
Jobs wrote:
> What's the difference between Convert.toString and
.toString() method
> ?
>
> Just to give an understanding of what the above
question means seethe
> 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's 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 good coding practice using
"convert" is always safe.
>
> Full Interview Questions for .NET and SQL Server
> http://www
.geocities.com/dotnetinterviews/
> Help the community to make job search easier mail your
questions to
> jobatyourdoorstep yahoo.co.in
> Looking for a onsite job mail your resumes at
> jobatyourdoorstep yahoo.co.in
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "C# Developers" group.
To post to this group, send email to CSDevelopers googlegroups.com
To unsubscribe from this group, send email to
CSDevelopers-unsubscribe googlegroups.com
For more options, visit this group at http://gr
oups.google.com/group/CSDevelopers
-~----------~----~----~----~------~----~------~--~---
|