What is the difference between Boxing and Unboxing in C#

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

Does visual c++ 2017 replace 2015?

588


Difference between getmessage, postmessage & peakmessage.

611


What is microsoft visual c++ 2015 redistributable package x64?

560


Is it safe to uninstall microsoft visual c++ 2008 redistributable?

568


How can we use cmutex?

562






What is ole? How do you handle drag and drop in ole?

553


What is cmutex?

585


Do I need all the microsoft visual c++ redistributable?

529


What is microsoft visual c++ 2013 redistributable package x64?

550


Explain the advantages of cwinthread class.

603


How to create a DLL in C++.net 2005 which we can use in VB 6.0 application ?

1759


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

554


How do I fix microsoft visual c++ 2015 setup failed?

583


Explain the significance of initapplication() in vc++.

656


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

699