What is the difference between Boxing and Unboxing in C#



What is the difference between Boxing and Unboxing in C#..

Answer / preetha

Boxing is a process in which object instances are created
and copy values in to that instance.
Unboxing is vice versa of boxing operation where the value
is copied from the instance in to appropriate storage
location.
Below is sample code of boxing and unboxing where integer
data type is converted in to object
and then vice versa.
Dim x As Integer
83
Dim y As Object
x = 10
‘ boxing process
y = x
‘ unboxing process
x = y

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More VC++ AllOther Interview Questions

Do I need ms visual c++ on my computer?

0 Answers  


What is more efficient to pass as a parameter--a pointer or an object? Why?

1 Answers  


What is difference between c++ and vc++?

0 Answers  


How a dll will be sharable by more than one exe?

4 Answers   CA,


what is mean [] inc what is the use of include conio.h in c

1 Answers   BirlaSoft,






what r the vc++ components

3 Answers  


What is the purpose of a C++ namespace?

2 Answers  


Name the three attributes of a pen?

1 Answers  


Do I need the microsoft visual c++?

0 Answers  


What is visual c++ redistributable?

0 Answers  


What is the default label used for in a switch statement?

2 Answers  


What is vc++ redistributable?

0 Answers  


Categories