Mike Labosh <ml*****@hotmail.com> wrote:
Can someone provide a link to something a bit more useful than the MSDN
topics?
Well, what exactly do you want to know? Boxing basically involves
taking a value type value, and creating an instance of a reference type
which effectively wraps that value. It's automatically performed
whenever you need a reference but only have a value - eg:
int i = 10;
object o = i; // Boxing!
Unboxing is the reverse, and requires a cast:
int j = (int) o; // Unboxing!
The type specified in the cast must be exactly right:
long l = (long) o; // Throws an exception at runtime
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too