Box the value type into a reference type : Byte box unbox : Data Type C# Examples


C# Examples » Data Type » Byte box unbox »

 

Box the value type into a reference type









    
using  System;
using  System.Collections;

class  MainClass
{
    static  void  Main(string[]  args)
    {        
        short  s  =  25;
        
        object  objShort  =  s;
        Console.WriteLine("Boxed  object  is  a:  {0}",  objShort.GetType().ToString());

    }
}
    
   
  
   



Output

Boxed object is a: System.Int16


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Byte box unbox