//���Ϸ���ʵ�� public int Add(Student student) { return base.List.Add(student); }
public void AddRange(Student[] students) { if (students == null) throw new ArgumentNullException("Student is null."); for (Int32 i = 0; i < students.Length; i++) { this.Add(students[i]); } }
//Main_7_9_8 public static void Main_7_9_8() { StudentCollection sc = new StudentCollection(); sc.Add(new Student("��", 27)); sc.Add(new Student("��", 22)); Student s = new Student("����", 36); sc.Insert(1, s); sc.Remove(s); foreach (Student student in sc) { Console.WriteLine("Name:{0}\tAge:{1}", student.Name, student.Age); } }
public StudentCollection(Student[] students) { this.AddRange(students); }
public void Remove(Student student) { base.List.Remove(student); }
public void Insert(Int32 index, Student student) { base.List.Insert(index, student); }
public int IndexOf(Student student) { return base.List.IndexOf(student); }
public void CopyTo(Student[] students, Int32 index) { base.List.CopyTo(students, index); }
public bool Contains(Student student) { return base.List.Contains(student); }