Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Object type and boxing

Tags:

c#

object

boxing

MSDN says that

The object data type is the type to and from which objects are boxed.

I thought only value types are boxed? Now I am bit confused. So when I assign reference type variable to object variable, its boxing?

like image 563
Michael Avatar asked Apr 12 '26 21:04

Michael


1 Answers

Only value types are boxed.

So, to be accurate the sentence should be:

"The object data type is the type to and from which values are boxed."

like image 175
Guffa Avatar answered Apr 14 '26 10:04

Guffa



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!