Mega Code Archive

 
Categories / C# Tutorial / Data Type
 

Implicit boxing from i to object

class MainClass {     static void Main()     {         int i = 123;         object o = i;  // implicit boxing         i = 456;  // change the contents of i         System.Console.WriteLine("The value-type value = {0}", i);         System.Console.WriteLine("The object-type value = {0}", o);     } }