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

Total Post:154

Posted on    January-26-2016 10:29 PM

 C# C#  .NET 

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

thank you.

Anupam Mishra

Total Post:135

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