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 does inheritance work in c#?

1056


How many parameters can a method have c#?

865


How to create multi-dimensional array?

1048


What is sorted list in c#?

841


If you donot specify an access modifier for a method, what is the default access modifier?

968


Is null == null c#?

835


What is bitwise operator in c#?

860


What are the problem with .NET generics?

926


How a two-dimensional array declared in C#?

909


What is difference between events and delegates?

887


What are delegates and why are they required?

914


How can we sort the elements of the array in descending order?

885


Describe an abstract class?

930


What are custom attributes in c#?

831


What is cookies in c# asp net?

882