Example #1
0
 public Student(int n)
 {
     gra = new grade[n];
     for (int i = 0; i < gra.Length; i++)
     {
         gra[i] = new grade();  // 深拷贝
     }
 }
Example #2
0
 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);
     }
 }