Home > DeveloperSection > Interviews > What is boxing in C#?

Posted on    September-22-2014 2:06 AM

 C# .NET  C# 
Ratings:
 1 Answer(s)
  788  View(s)
Rate this:

Sumit Kesarwani

Total Post:782

Points:3910
Posted on    September-22-2014 2:06 AM

Boxing is the process of explicitly converting a value type into a corresponding reference type. Basically, this involves creating a new object on the heap and placing the value there. Reversing the process is just as easy with unboxing, which converts the value in an object reference on the heap into a corresponding value type on the stack. The unboxing process begins by verifying that the recipient value type is equivalent to the boxed type. If the operation is permitted, the value is copied to the stack.


Don't want to miss updates? Please click the below button!

Follow MindStick