Пример #1
0
        public void AddRange(StudentCollection studentCollection)
        {
            if (studentCollection == null)
            {
                throw new ArgumentNullException("Student is null");
            }

            foreach (Student s in studentCollection)
            {
                this.Add(s);
            }
        }
Пример #2
0
        public static void Main_7_9_8()//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);
            }
        }
Пример #3
0
        //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);
            }
        }
Пример #4
0
        public void AddRange(StudentCollection studentCollection)
        {
            if (studentCollection == null)
                throw new ArgumentNullException("Student is null");

            foreach (Student s in studentCollection)
            {
                this.Add(s);
            }
        }