Boxing � Process of converting a System.ValueType to Reference Type , Mostly base class System.Object type and allocating it memory on Heap .
Reverse is unboxing , but can only be done with prior boxed variables.
How Boxing and unboxing occures in memory?
Boxing converts value type to reference type , thus allocating memory on Heap . Unboxing converts already boxed reference types to value types through explicit casting , thus allocating memory on stack .
No comments:
Post a Comment