Change the value after boxing : Boxing Unboxing : Data Type C# Examples


C# Examples » Data Type » Boxing Unboxing »

 

Change the value after boxing









    
using  System;

class  MainClass
{
      static  void  Main()
      {
            int  i  =  10;                      
            object  oi  =  i;                
            
            Console.WriteLine("i:  {0},  io:  {1}",  i,  oi);
            
            i    =  12;
            
            Console.WriteLine("i:  {0},  io:  {1}",  i,  oi);
            
            oi  =  15;
            Console.WriteLine("i:  {0},  io:  {1}",  i,  oi);
      }
}
    
   
  
   



Output

i: 10, io: 10
i: 12, io: 10
i: 12, io: 15


HTML code for linking to this page:

Follow Navioo On Twitter

C# Examples

 Navioo Data Type
» Boxing Unboxing