I found the following code snippet while searching about boxing and unboxing in C#.
class TestBoxing
{
static void Main()
{
int i = 123;
// Boxing copies the value of i into object o.
object o = i;
// Change the value of i.
i = 456;
// The change in i does not effect the value stored in o.
System.Console.WriteLine("The value-type value = {0}", i);
System.Console.WriteLine("The object-type value = {0}", o);
}
}
/* Output:
The value-type value = 456
The object-type value = 123
*/
Over here it says that even though he value of i changes the value of o remains the same.If so then o is referencing to the value "123" and not i.Is it so?If o stored the value of i then when the value of I was changed the value of o would have changed too. Please correct me if I am wrong.
please read the full article on MSDN.