Introduction

In this example, explaining in detail difference between Boxing and Unboxing in ASP.Net. Boxing is the process of converting value type to object type and unboxing is reverse process of object type to value type. I have illustrated the concept as given below:

Boxing Unboxing in C#

Boxing

Int i;
I=78;
Object o = i;   (Boxing)

Unboxing

Int i;
Object o;
o = 8;
i = o; (Unboxing)

Summary

Box and Unboxing is unified view which indicates that value type can be treated as an object. Boxing is implicit, unboxing is explicit. You see here how Boxing and Unboxing in ASP.Net is explained in detail.

Relevant Reading: