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 is c# used for in the industry?
How to add a readonly property in c#.net
Is c# good for games?
What are annotations in c#?
Explain boxing and unboxing in c#?
Explain the process of Serialization?
Why is lazy loading?
What operator means?
Can you have an array of arrays?
Can you instantiate a struct without using a new operator in c#?
Can we set image Source dynamically using C# in WPF application?
What are extensions methods in c#?
Is java better than c sharp?
Give an example of a ctype.
What is multithreading? What are the problems that comes with multithreading and how to manage them?