in Dot Net by

What are Boxing and Unboxing?

▼ Show 1 Answer

0 votes

Converting a value type to reference type is called Boxing.

For Example:

int Value1 -= 10;


object boxedValue = Value1;

Explicit conversion of same reference type (created by boxing) back to value type is called Unboxing.

For Example:


int UnBoxing = int (boxedValue);

Learn More with Madanswer

Related questions

+1 vote
asked Jun 25, 2019 in Dot Net by Venkatshastri