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

How can i communicate with two systems one is located some place another is located 100km how from the current systems which protocala i have to use

2 Answers   Invensys,


Explain pointer to the constant and constant pointer? Explain difference between them.

0 Answers  


What is cmutex?

0 Answers  


What is the use of microsoft visual c++ 2015 redistributable?

0 Answers  


What are some differences between a form view and a dialog box?

2 Answers   DS Group, Manipal Ecommerce,






Is microsoft visual c++ important?

0 Answers  


A file a.cpp & B.cpp are complied & linked together in VC++ file a is something like int a =100;, File B is something like extern a; main() { printf("%d",a); }what will be the output.a)100,b)linker error,c)complier error etc etc.

3 Answers   Honeywell,


How do you handle drag and drop in ole?

0 Answers  


What is cmutex? How can we use it?

0 Answers  


Can I uninstall visual c++?

0 Answers  


What is the difference between the cout and cin iostream objects?

7 Answers  


Explain pointer to the constant and constant pointer?

0 Answers  


Categories