What is boxing and unboxing ?

Answers were Sorted based on User's Feedback



What is boxing and unboxing ?..

Answer / pandian

Box is used to convert Value type to reference type(ie.
Object)
Unboxing is the reverse of the boxing.

Is This Answer Correct ?    7 Yes 0 No

What is boxing and unboxing ?..

Answer / hanuman

Boxing is a concept of converting value types into reference types and vice versa is called UnBoxing

Is This Answer Correct ?    0 Yes 0 No

What is boxing and unboxing ?..

Answer / kirti

Boxing:

The conversion of a value type instance to an object, which implies that the instance will carry full type information at run time and will be allocated in the heap. The Microsoft intermediate language (MSIL) instruction set's box instruction converts a value type to an object by making a copy of the value type and embedding it in a newly allocated object.

Un-Boxing:

The conversion of an object instance to a value type.

Is This Answer Correct ?    0 Yes 0 No

What is boxing and unboxing ?..

Answer / kirti

Boxing :- Boxing is an implicit conversion of a value type to the type object type

Eg:-

Consider the following declaration of a value-type variable:

int i = 123;

object o = (object) i;

Boxing Conversion

UnBoxing :- Unboxing is an explicit conversion from the type object to a value type

Eg:

int i = 123; // A value type

object box = i; // Boxing

int j = (int)box; // Unboxing

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net Remoting Interview Questions

What is fundamental of published or precreated objects in remoting?

0 Answers  


Define delegates and events?

0 Answers  


About remoting and web services. Difference between them?

6 Answers   Microsoft,


Explain when we use web service and when we use remoting?

0 Answers  


What is unmanaged code?

0 Answers  






When we use web service and when we use Remoting?

2 Answers  


How to decide which to use .net remoting or asp.net web services?

0 Answers  


what are the requirements to enable remote components to interact each other?

0 Answers  


How to register a shared assembly ?

1 Answers   Digital GlobalSoft,


What is delay signing?

2 Answers   HCL,


Are you aware of containment and Aggregation ?

0 Answers   DELL,


Which one is better WebService and Remoting ?

0 Answers   NA,


Categories