What is boxing and how it is done internally?

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the full form of gac?

656


How to use the FindControl() function to preselect an item in my dropdownlist?

1711


How can you pause a timer control?

649


i already displaying one datagrid. now i want to make change to particular column header i.e i want to split that column header and it includes one more header.... write a code for that in windows application using C#.net

1502


What are windows based applications?

542






Suppose I am implementing one windows form. I am inserting some values into ms access. In that table 5 columns there. But I want to insert three columns only. When I am clicking another button then other two values also insert into that table?

554


Explain how insert record in the database?

631


Which property of the progressbar control specifies the amount to increment the current value of the control?

534


How do I change the console application in windows?

507


Explain how barcode create in the report?

581


How to split a column header in gridview using c#.net?

730


Which command prompt utility is used to convert a resource file from the text format into the binary format?

617


Which of the following position is the default docking position of the statusstrip control on the form?

593


What is the difference between pixels, points, and em’s when fonts are displayed?

567


How is anchoring different from docking?

608