What is boxing and how it is done internally?

Answers were Sorted based on User's Feedback



What is boxing and how it is done internally?..

Answer / surya

Boxing is an implicit conversion of a value type to the
type object
int i = 123; // A value type
Object box = i // Boxing
CASTING: casting is the process of converting a variable
from one type to another (from a string to an integer)
Unboxing is an explicit conversion from the type object to
a value type
int i = 123; // A value type
object box = i; // Boxing
int j = (int) box; // Unboxing

Is This Answer Correct ?    14 Yes 0 No

What is boxing and how it is done internally?..

Answer / sesu

Boxing is the conversion value type to ref. type.

int i=5 -- value type
Object obj; -- Referance type
obj=i; -- Boxing


int j =(int) obj -- Unboxing

Is This Answer Correct ?    12 Yes 0 No

What is boxing and how it is done internally?..

Answer / sandhya

Boxing is an implicit conversion of a value type to the
type object
int i = 123; // A value type
Object box = i // Boxing

In case of value type ,value is stored in the stack but
after boxing process value is stored in to heap.

Is This Answer Correct ?    6 Yes 1 No

What is boxing and how it is done internally?..

Answer / sudhir singh

the process of converting value type to reference type is
called as boxing.
it is an implicit conversion.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Dot Net WindowsForms Interview Questions

What is the use of stretch property in Image control?

1 Answers  


What is the full form of gac?

0 Answers  


How will calculated the net amount in tax add like total net amount = LT+ST+CESS+amount 2500 = 10%+12.5%+5.15%+amount? kindly please explain what type of formula we apply in software? Tushar

0 Answers  


Is typeform free?

0 Answers  


How to show a ContextMenuStrip instead of cthe default ContextMenuStrip,when you rightclick on the non client area of a window's Form or when alt+space keys are pressed

0 Answers  






Where to use new keyword other than create instance?

0 Answers  


What are the three states set in a checkstate property?

0 Answers  


How do I change the console application in windows?

0 Answers  


how see report periviwe

0 Answers   Wipro,


What is the use of lock keyword in C#?

1 Answers  


Explain about crystal report in brief?

0 Answers  


Which interface is to be implemented to release the unmanaged resources in an object in Dot Net?

1 Answers   Arctern,


Categories