static void Main(string[] args) { ClassRoom temp = new ClassRoom(3); Student one = new Student(); one.Id = 1343; temp.AddStudent(one); Student two = new Student(); two.Id = 4532; temp.AddStudent(two); Student free = new Student(); free.Id = 6734; temp.AddStudent(free); foreach (var j in temp) { Console.WriteLine(((Student)j).Id); } }
public void AddStudent(Student student) { _students[count] = student; count++; }
public object Clone() { Student student = new Student(); student.Id = this.Id; return student; }