Home > DeveloperSection > Forums > What is Boxing and Unboxing type conversion?
Manoj Bhatt
Manoj Bhatt

Total Post:153

Points:1079
Posted on    January-26-2016 10:29 PM

 C# C#  .NET 
Ratings:


 1 Reply(s)
 275  View(s)
Rate this:
Hi....
 I am little bit confuse between boxing and unboxing , Please give me a answer.

thank you.


Anupam Mishra

Total Post:135

Points:949
Posted on    January-26-2016 11:34 PM

C# Type System contains three Types , they are Value Types , Reference Types and Pointer Types. C# allows us to convert a Value Type to a Reference Type, and back again to Value Types . The operation of Converting a Value Type to a Reference Type is called Boxing and the reverse operation is called Unboxing.
int Value1 = 1;
Object Object1 = Value1; //Boxing

int i = (int)Object1; //Unboxing


Don't want to miss updates? Please click the below button!

Follow MindStick