I have read in CLR via C#:
Unboxing is really just the operation of obtaining a pointer to the raw value type (data fields) contained within an object.
which means that if more than one value type is contained within an object they can be unboxed using the below syntax:
int a= (int) o; //assigns a to 10
char b= (char) o; // assigns b to 'b'
How to implement such object which supports multiple unboxing?
A boxed value can only be the boxed form of a single type - if you call o.GetType()
you'll find out what that is.
In general, you can only unbox to the exact same type, with a few wrinkles:
So for example:
object o = 10;
FileMode mode = (FileMode) o; // Valid conversion to enum
int? n = (int?) o; // n has a value of 10
n = null;
o = n; // o's value is a null reference
n = (int?) o; // n's value is the null int? value
See more on this question at Stackoverflow