1:People.Pupil = new Pupil{Name="zhd",Sex="Man"};
2:Student s = People.Pupil;
“2”是一个简单的赋值语句,s引用(或指向)People.Pupil对象,当对象发生改变时,自然而然,s也改变。实际上是:s通过引用(或指向)对象的“首地址”来“引用”该对象。
1:People.Pupil = new Pupil{Name="zhd",Sex="Man"};
2:Student s = People.Pupil;
“2”是一个简单的赋值语句,s引用(或指向)People.Pupil对象,当对象发生改变时,自然而然,s也改变。实际上是:s通过引用(或指向)对象的“首地址”来“引用”该对象。