Student s1 = new Student("Vivi", 28);
Console.WriteLine("s1=[" + s1 + "]");
Student s2 = (Student)s1.ShallowCopy();
//Student s2 = (Student)s1.DeepCopy();
Console.WriteLine("s2=[" + s2 + "]"); //此处s2和s1内容相同
Console.WriteLine("-----------------------------");
//修改s2的内容
s2.Name = "tianyue";
s2.Age = 25;
s2.Room.RoomID = 2;
s2.Room.RoomName = "Room2";
Console.WriteLine("s1=[" + s1 + "]");
Console.WriteLine("s2=[" + s2 + "]");
//再次打印两个对象以比较
Console.ReadLine();