Total Pageviews

Wednesday, May 12, 2010

What is Boxing & Unboxing in C#?

Boxing means converting Value type to a Reference type.

Ex :

int i=100;

object obj=(object) i;

Unboxing means converting Reference type to a Value type.

Ex:

object obj=100;

int i=(int)obj;

No comments:

Post a Comment