Interview Questions

What is the difference between boxing and unboxing?

ASP.NET and .NET WEB Questions and Answers


(Continued from previous question...)

What is the difference between boxing and unboxing?

Boxing allows us to convert value types to reference types. Basically, the runtime creates a temporary reference-type box for the object on heap.
Eg:
int i=20;
object o=i;

(Continued on next question...)

Other Interview Questions