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...


What is boxing and unboxing ?

Answers were Sorted based on User's Feedback



What is boxing and unboxing ?..

Answer / narayansahu

boxing is conversion from value type to object(reference)
type.Actually the copy of value type copied from stack to
heap memory.
unboxing is reverse of it.from heap memory back to stack
memory.

Is This Answer Correct ?    70 Yes 4 No

What is boxing and unboxing ?..

Answer / satyambabu

BOXING
? Boxing is an implicit conversion of a value type to
the type object

UNBOXING
? Unboxing is an explicit conversion from the type
object to a value type

Is This Answer Correct ?    28 Yes 4 No

What is boxing and unboxing ?..

Answer / narayansahu

Boxing and Un-boxing

Boxing allows value types to be implicitly treated like
objects.

Dim i As Integer = 5
i.ToString() ' i --> object --->object.tostring

OR

Dim i As Integer = 5
Dim obj As Object = i ' implicit boxing
obj.ToString()

OR you can do it explicitly
Dim obj As Object = CType(i, Object) ' un-necessary
explicit boxing

On the other hand, un-boxing is an explicit conversion from
object type to value type.

Dim i As Integer = 5
Dim obj As Object = i ' implicit boxing
Dim j As Integer = CType(obj, Integer) ' explicit un-boxing



? Boxing and Un-boxing is the transformation between
value type and object type while casting just transforms
the apparent (reference) type of objects.
? Value types are stored at the stack and objects are
stored at the heap.
Boxing takes a copy of value types from the stack to the
heap while un-boxing takes value types back to the stack.
On the other hand, casting does not physically move or
operate on an object. Casting merely changes the way
objects are treated in a program by altering their
reference type.

Is This Answer Correct ?    23 Yes 6 No

What is boxing and unboxing ?..

Answer / manish singh(amalga fusion)

boxing is used to convert value type to reference type.
unboxing is used to convet reference type to value type.

Is This Answer Correct ?    21 Yes 4 No

What is boxing and unboxing ?..

Answer / rahultripathi

There is two type datatype available Value and reference
type . value are stored in stack and reference type used
in heap . when we copy data from stack memmory to heap it
call Boxing .


Int32 x = 10; object o = x ; // Implicit
boxing
Int32 y = 10;

unboxing : copy data from heap memory to stack called
unboxing
object obj = (object) y; // Explicit Boxing


Rahul Tripathi
raultripathi@myway.com

Is This Answer Correct ?    18 Yes 2 No

What is boxing and unboxing ?..

Answer / sivasaravanan

Boxing;
Encapsulating a copy of value in an object.
UnBoxing:
Vice-versa

Is This Answer Correct ?    14 Yes 2 No

What is boxing and unboxing ?..

Answer / subhrajit maity

in Csharp language boxing is used to convert value type to
object (reference type).
value to reference.
In this time value copied from stack to heap.
For un boxing convert reference to value.
Value copied from heap to stack

Is This Answer Correct ?    8 Yes 3 No

Post New Answer

More ASP.NET Interview Questions

How to you can limit Access to Web API to Specific HTTP Verb?

0 Answers  


What is voluum?

0 Answers  


What is the difference between adding reference in solution explorer and adding references by using ?

0 Answers  


How do you use viewstate?

0 Answers  


What are the type of session in Asp.Net

3 Answers  


Describe Segmentation With Paging?

0 Answers   MaxSolPro,


What is asp.net and ado net?

0 Answers  


what is webservices. howit is use in our project .

1 Answers   Patni,


Explain the working of passport authentication.

0 Answers  


What is route in web api?

0 Answers  


How to convert a string into an Integer in ASP.net?

12 Answers  


What is the main difference between a static page and a dynamic page?

2 Answers  


Categories