Boxing — converting value type to reference type. Unboxing — converting back.
Boxing:
1int x = 10; // Value type2object obj = x; // Boxing3// obj now points to heap-allocated int
Unboxing:
1object obj = 10;2int y = (int)obj; // Unboxing3// int z = (string)obj; // Error!
Performance:
Better alternative:
1// Instead of boxing2List<int> list = new List<int>();3list.Add(10); // No boxing with generics