static void 박싱2()
{
TestStruct t = new TestStruct(1, 1);
Console.WriteLine(t);
t.Change(2, 2);
Console.WriteLine(t);
Object o = t;
Console.WriteLine(o);
((TestStruct)o).Change(3, 3);
Console.WriteLine(t);
Console.WriteLine(o);
}
struct TestStruct
{
private int a, b;
public TestStruct(int a, int b)
{
this.a = a;
this.b = b;
}
public void Change(int x, int y)
{
this.a = x;
this.b = y;
}
public override string ToString()
{
return String.Format("{0},{1}", this.a.ToString(), this.b.ToString());
}
}
여기서 마지막 Console.WriteLine(o);가 3,3이아니고 2,2인 이유는 무엇인가요??