In a sentence, Boxing is the process of converting value type to reference type.
Ex
int i=6; // Integer ‘i' is value type
Object o = i; // Object ‘o’ is reference type
Unboxing is the reverse process of the boxing like converting reference type to value type.
Object o = 6; // Object ‘o’ is reference type
Int i= (int)o; // Integer ‘i' is value type
Now here the another question in mind,
- What is Value and Reference type?
- What all are the value type and reference types?
Now start with:
What is Value and Reference type?
Value and Reference type are the two data types in c#.
Value type
Those variable which can contain the data directly that all falls in value type data type. As above example,
int i=6;
Here we are assigning the value directly to the variable.




Sudarshan BhatPosted Feb 10, 2022, 1:27 PM
Clean and Clear Article. Very much helpful.
Dinesh KumarPosted Feb 2, 2022, 9:32 AM
Nice article