What is Boxing and Unboxing type conversion?

Total Post:154

Points:1086
C#  .NET 
C#
 802  View(s)
Ratings:
Rate this:
Hi....
 I am little bit confuse between boxing and unboxing , Please give me a answer.

thank you.
  1. Post:135

    Points:949
    Re: What is Boxing and Unboxing type conversion?

    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

      Modified On Apr-11-2018 12:52:28 AM

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!