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
Can we overload indexer in c#?
How do you sort a list in c#?
How will you allow a class to be inherited, but prevent the method from being over-ridden?
Why are strings in c# immutable?
What are the different types of constructors?
Why c# is called type safe language?
Which class does the remote object has to inherit?
What is executereader in c#?
Can we have two main methods in c#?
What is the difference while using directive vs using statement ?
What is difference between first and firstordefault?
Give some examples for built in datatypes in c#?
Distinguish between finally and finalize blocks?
What is boolean conditions in c#?
What is yield c#?