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
Explain how to implement delegates in c#.net
Explain boxing and unboxing in c#?
Why do we need nullable types in c#?
What is cli in c#?
How to transpose multi-dimensional array?
What are predicates in c#?
Explain the difference between directcast and ctype.
Explain About .NET Remoting and types of remoting
What is the differences between datagrid, datalist and repeater in .net?
Are structs faster than classes?
What is an xsd file?
Why c# is type safe?
What is virtual class in C#?
How to use reflection to call generic method?
Why do we use delegates?