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

Is visual c++ still used?

633


What is microsoft visual c++ used for?

638


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

780


What is cmutex? How can we use it?

646


How do you handle drag and drop in ole?

674






Is microsoft visual c++ a virus?

751


How do I remove microsoft visual c++ 2015 redistributable?

656


How do I create an mfc application in vc++?

704


What is vcruntime?

677


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

624


What is microsoft visual c++ 2008 redistributable?

678


Where can I find microsoft visual c++ on my computer?

680


What is vc++ redistributable?

822


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

619


Do I need microsoft visual c++ 2005 redistributable on my computer?

730