Blog author:
Sourabh07 | Posted on: 10/29/2012 | Category:
C# Blogs | Views: 427 | Status:
[Member] |
Points: 75
|
Alert Moderator
Boxing:
1) Converting the value type to the object type ( means to say it gets the value from the value type and stores it in the managed heap.
2) is Implicit
eg:
int i = 77;
object obj = i; /* It can simply assign to the type object in boixing and in technical term it boxes i */
UnBoxing:
1) Converting the value from the object type to the value type (extracting the value and assigned to the value type)
2) is Explicit
eg:
object obj = 70;
int i = (int) obj; /* unboxing the value wrapped inside the object type obj */
Sourabh07
Found interesting? Add this to: