What is Boxing and Unboxing?

Easy0-2 Years

Boxing converts a value type into an object.

Unboxing converts an object back into a value type.

Example

int number = 100;

object obj = number;

int value = (int)obj;

Interview Tips

Boxing is implicit.

Unboxing is explicit.