Interview Questions

What happens in memory when you Box and Unbox a value-type?

C# Interview Questions and Answers


(Continued from previous question...)

209. What happens in memory when you Box and Unbox a value-type?

Boxing converts a value-type to a reference-type, thus storing the object on the heap. Unboxing converts a reference-type to a value-type, thus storing the value on the stack.

(Continued on next question...)

Other Interview Questions