Answer Posted / ritesh kumar
Boxing is converting a value type to a reference type
(Object Type).Casting is converting a reference type to a
reference type or a value type as another value type.
int i = 0;
object o = (object)i; //this is boxing
int i2 = (int)o; //this is unboxing.
long l = (long)i; //this is casting.
| Is This Answer Correct ? | 29 Yes | 1 No |
Post New Answer View All Answers
What does namespace mean?
What is difference between mutable and immutable in c#?
How does foreach loop work in c#?
What do constructors do in c#?
What are strongly typed objects?
What is the difference between var and dynamic types in c# 4.0?
How do generics work in c#?
What is the difference between firstordefault and singleordefault?
Is datetime immutable c#?
What do you use c# for?
Why do I get a syntax error when trying to declare a variable called checked?
What are winforms in c#?
What are some of the commonly used commands in sqlcommand?
What is a thread c#?
What is the difference between select and selectmany?