boxing means converting value type to reference type and
unboxing means converting reference type to value type.why
we need boxing and unboxing?
Answer Posted / deepak
actually we need boxing and unboxing to keep more than one type of value type of variables in a common reference type of collection.. so that you can do the common operation in a loop or anywhere else.. by unboxing one by one.. also you can pass that collection to any method.. so you dont need to make many overloaded method for every type of value type..
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What are the Types of values mode can hold session state in web.config
What are the differences between a class and a struct?
We cannot create instances of static classes. Can we have constructors for static classes?
Is it possible to inline assembly or il in c# code?
What is an enumerator in c#?
What is static void main in c#?
What are custom exceptions in C#?
What is the interface in c#?
How to implement delegates in c#.net
Explain the 3 types of properties in c# with an example?
How to Show Message box in Metro Style App?
What is view state c#?
What is extension method in c sharp?
what is collections in .net? why we use?
What is an array of arrays called?