+1 vote
in Dot Net by

What are Boxing and Unboxing?

1 Answer

0 votes
by

Converting a value type to reference type is called Boxing.

For Example:

int Value1 -= 10;

//————Boxing——————//

object boxedValue = Value1;

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

For Example:

//————UnBoxing——————//

int UnBoxing = int (boxedValue);

Related questions

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