what is the diference between casting and converting?
Answer Posted / kiran vaidya
When you use Convert class, you have some predefined types
which are defined by .Net framework such as Convert.ToInt32
or Convert.ToString and so on. That means you can convert
whatever you want to only system defined types.
while in casting, you can have your own choices to convert
data. i.e. user defined types.
for eg. you have a class called Employee and you want to
convert some object to Employee, then the best way to do
this is casting.
| Is This Answer Correct ? | 10 Yes | 0 No |
Post New Answer View All Answers
Which is faster dictionary or hashtable?
Is c# pass by value?
Does c# have a 'throws' clause?
What is c-sharp (c#)?
Why do we use polymorphism in c#?
What is an array class?
Why main method is static in c#?
What is reference c#?
What is mvc pattern in c#?
What is data bind in c#?
What are the types of comment in c# with examples?
What is difference between an reference type and value type in C#?
Why we use delegates in c#?
What are value types in c#?
What is console readkey in vb net?