answersLogoWhite

0


Best Answer

"Boxing" operations are used whenever a value type is needs to be treated as an object type. You most commonly see this when passing a value type (such as an integer) to a method or parameter that expects an object type.

Simply Boxing means the conversion of the value type on the stack to a object type on the heap, similarly the conversion from an object type back to a value type is called as unboxing.

In object oriented programming languages, methods are called using object. Value types such as int is not object, we cannot use that to call methods. But in C# we can do this with the help of Boxing.

see this:

http://www.authorcode.com/boxing-and-unboxing-in-c/

User Avatar

Wiki User

12y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the use of boxing and unboxing operations in c sharp?
Write your answer...
Submit
Still have questions?
magnify glass
imp