Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

boxing means converting value type to reference type and
unboxing means converting reference type to value type.why
we need boxing and unboxing?

Answer Posted / uday

We use boxing and un-boxing when we assign a value to an
object and vice-versa.
Ex:

Int i=10;
Object o=i //this is boxing
int j=(int)o; //this is unboxing

When u say boxing, an object box is allocated and then the
value is copied to that box.
When u unbox, the value is copied out of the object box and
copied into storage location.

Is This Answer Correct ?    13 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I edit a dll file?

935


What is the difference between disposing of () and finalize() methods in c#?

1057


What is the advantage of constructor?

958


Explain circular reference in c#?

995


What is xml document how do you open it?

1016


What do you mean by for each loop?

965


What is the use of getcommandlineargs() method in c#.net?

1025


What is winforms c#?

1078


Describe ways of cleaning up objects in c#.

947


What is the size of a decimal?

1131


Does c# support multiple inheritance (mi)?

1002


Can we override constructor in c#?

965


Why would you use untrusted verification?

982


Why static variables are used?

1082


What is the difference between static and private constructor in c#?

1065