What is Boxing and Unboxing? - .Net Views : 234
Tagged in : .Net
0 0
Send mail
Boxing
Value Types are stored on the stack and Reference types are stored on the heap. The conversion of value type to reference type is known as boxing.

Example:

int i = 123;
object o = (object)i; // boxing


Unboxing
The conversion of reference type back to the value type is known as unboxing.

Example:

o = 123;
i = (int)o; // unboxing
By Nithya, On - 2010-01-30



    Login to add Comments .