예제 #1
0
 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);
     }
 }
예제 #2
0
 public void AddStudent(Student student)
 {
     _students[count] = student;
     count++;
 }
예제 #3
0
 public object Clone()
 {
     Student student = new Student();
     student.Id = this.Id;
     return student;
 }