Please suggest..
which among the following are unboxing example:
enum E={"Hello World"};
void sample(System.Enum et)
{
E e = (E) et;
}
OR
class C = {public int Value{get;set;}}
void sample1(C ct)
{
int i = ct.Value;
}
Unboxing doubt
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Alok UniyalRank #8,369 · 223 reputationPosted Jan 23, 2012, 11:27 PM EST
Jignesh TrivediRank #16 · 50.3K reputationPosted Jan 24, 2012, 6:13 PM EST
Unboxing is an explicit conversion from the type object to a value type or from an interface type to a value type that implements the interface. An unboxing operation consists of:
- Checking the object instance to make sure it is a boxed value of the given value type.
- Copying the value from the instance into the value-type variable.
int i = 123; // A value typeobject box = i; // Boxing
int j = (int)box; // Unboxing
here enum is value type
refer http://msdn.microsoft.com/en-us/library/s1ax56ch%28v=vs.80%29.aspx
so there is no unboxing.
hope this help.