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

What is the data provider name to connect to access database?

993


What is pure abstract class in c#?

913


What are different types of classes in c#?

913


Differentiate between method overriding from method overloading with its functionality?

1039


Write a console application and implement the ternary operator to decide whether the age a user entered after being prompted is allowed to vote or not(given that only citizens between 18 and 120 years only inclusive can vote). Use exception handling for non-numerical input.

2369


Write a sample code to write the contents to text file in c#?

961


Expalin the way you implement inheritance by using VB.NET/C#?

978


What is default class in c#?

934


What's different between c# and c/c++?

960


What are object pooling and connection pooling and difference? Where do we set the Min and Max Pool size for connection pooling?

1161


What is ilist c#?

958


Explain how do I convert a string to an int in c#?

981


What is reference types in c#?

1000


Why do we need to call CG.SupressFinalize?

1003


How can it prevents DLL Hell assembly versioning in .NET?

1031