0
의 속성으로
this.Grades = 새로운 스택을 추가 할 수 있습니다 많은 감사! (처음이 나쁜 포맷 죄송 스택 오버 플로우에 대한 질문) 당신의 생성자에서
class Student : Person
{
public int studentID { get; set; }
public static int nextID;
public Stack<int> Grades;
public Student(string firstName, string lastName, DateTime birthDate,
string address1, string address2, string city, string state,
string zip, string country)
{
FirstName = firstName;
LastName = lastName;
BirthDate = birthDate;
Address1 = address1;
Address2 = address2;
City = city;
State = state;
Zip = zip;
Country = country;
//track the number of students enrolled
studentID = nextID;
nextID++;
}
}