public Student(int n) { gra = new grade[n]; for (int i = 0; i < gra.Length; i++) { gra[i] = new grade(); // 深拷贝 } }
public Student(string name, int studentnumber, params grade[] c) { Name = name; Studentnumber = studentnumber; gra = new grade[c.Length]; for (int i = 0; i < gra.Length; i++) { gra[i] = new grade(c[i].Subject, c[i].Score); } }