boxing

Wrapping a value type such as an int in an object on the heap so it can be treated as an object.

In more detail

Boxing allocates memory and unboxing needs a cast, which is why pre-generic collections of object were slow and error-prone. Generics avoid it.

Related terms

Taught in

References