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

Explain what is the smallest unit of execution in .net?

921


How Reflection is used and what it's significance ?

912


What is a callback c#?

983


Is unboxing an implicit conversion?

1009


What is the difference between “constant” and “readonly” variables in c#?

988


What is the different types of private assembly and shared assembly?

984


What is the process of Serialization?

980


What is yield return in c#?

926


Why abstraction is used in c#?

913


How can I get the ascii code for a character in c#?

1047


Explain the difference between the debug class and trace class?

875


What is the .net datatype that allows the retrieval of data by a unique key?

886


What is ac callback?

889


What is the difference between read and readline in c#?

907


When is a class declared as a class abstract?

970