What is the difference between boxing and unboxing?

Q

What is the difference between boxing and unboxing?

✍: Guest

A

Boxing allows us to convert value types to reference types. Basically, the runtime creates a temporary reference-type box for the object on heap.
Eg:
int i=20;
object o=i;

2014-02-13, 1567👍, 0💬