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

Do I need the microsoft visual c++?

553


Is microsoft visual c++ important?

630


What is cmutex?

575


how to declare and populate an array of checkBoxes

675


Can I delete old microsoft visual c++?

545






What is iunknown?

549


What is visual c++ runtime?

585


How do I install microsoft visual c++ 2015?

535


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

1748


What is vcredist_x86 exe?

604


What is cmutex? How can we use it?

572


What is a wizard?

1776


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

563


What is a thread (VC++) and state the difference between Cmutex and Csemaphone?

608


What is iunknown? Explain some of commonly used methods provided by iunknown.

605