implicit boxing from i to object : int Box Unbox « Data Type « C# / CSharp Tutorial






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);
    }
}








2.6.int Box Unbox
2.6.1.Integer Autobox
2.6.2.Box int to object and unbox it back
2.6.3.implicit boxing from i to object