Boxing is the process of converting a value type to the type object.
e.g
int i = 123;
object o = (object)i; // boxing
Unboxing extracts the value type from the object.
o = 123;
i = (int)o; // unboxing
e.g
int i = 123;
object o = (object)i; // boxing
Unboxing extracts the value type from the object.
o = 123;
i = (int)o; // unboxing
No comments:
Post a Comment