Friday, June 28, 2013

What is Boxing/Unboxing?

Tags

Boxing is used to convert value types to object.
E.g. int x = 1;
object obj = x ;
Unboxing is used to convert the object back to the value type.
E.g. int y = (int)obj;
Boxing/unboxing is quiet an expensive operation.


EmoticonEmoticon