Boxing : Boxing is the process of converting a value type to the object type.When the CLR boxes a value type, it wraps the value inside a System.Object and stores it on the managed heap. Example :
int i = 123; // The following line indicates the boxing of i. object o = i;
Unboxing : Unboxing is an explicit conversion from the type object to a value type
o = 123; // The following line indicates the unboxing of o. i = (int)o;
Liked By
Write Answer
What is Boxing and Unboxing in C#
Join MindStick Community
You have need login or register for voting of answers or question.
Niraj Kumar Mishra
24-Aug-2017Boxing is the process of converting a value type to the object type.When the CLR boxes a value type, it wraps the value inside a System.Object and stores it on the managed heap.
Example :
Unboxing :
Unboxing is an explicit conversion from the type object to a value type