Boxing is implicit and unboxing is explicit. Unboxing is the explicit conversion of the reference type created by boxing, back to a value type.
Let us see an example of variable and object in C# −
// int int x = 30; // Boxing object obj = x; // Un boxing int unboxInt = (int) obj;
The following is an example showing Un boxing −
int x = 5; ArrayList arrList = new ArrayList(); // Boxing arrList.Add(x); // UnBoxing int y = (int) arrList [0];