top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

what is the difference between boxing and unboxing in c#.net?

+1 vote
160 views
what is the difference between boxing and unboxing in c#.net?
posted Aug 4, 2014 by Arun

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+2 votes

Boxing : Converting value type to object
Example :
int a=50;
object o=a;

UnBoxing: Converting object type to Value type
Example

object o=21;
int a=(int)o;

answer Aug 7, 2014 by Vinoth Kumar
converting a value type into a reference type is called boxing then, that reference type again converted to a value type is called un-boxing...
Boxing: int i=100;
obj obj=i;

Un-Boxing: int j= Convert.ToInt32(obj);
Similar Questions
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...