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
What do you know about device context?
Why do we use dataset in c#?
Explain attributes in c#?
What is data adapter in c#?
What are bitwise logical operators?
How can you write a class to restrict that only one object of this class can be created (Singleton class)?
What is a console device?
What is ado c#?
How can I make sure my c# classes will interoperate with other .net languages?
What is the use of nullable types in c#?
What are the classes contained in a single .NET DLL ?
Are value types sealed?
Explain the process of polymorphism with an example?
What are destructors in C#?
What is autopostback in c#?