What are Boxing and Unboxing?
- Converting a value type to reference type is called Boxing.
Ex:
int Value1 -= 10;
object boxedValue = Value1;
- Explicit conversion of same reference type (created by boxing) back to value type is called Unboxing.
Ex:
//-----UnBoxing------//
int UnBoxing = int (boxedValue);
No comments