コード例 #1
0
ファイル: Program.cs プロジェクト: 5avel/InheritanceTasks
        static void Main(string[] args)
        {
            ClassRoom classRoom = new ClassRoom(
                new GoodPupil(),
                new Pupil()
                );

            classRoom.Study();
            classRoom.Write();
            classRoom.Read();
            classRoom.Relax();
        }
コード例 #2
0
        static void Main(string[] args)
        {
            ClassRoom classRoom = new ClassRoom(new ExcelentPupil(), new GoodPupil(), new BadPupil());

            classRoom.Study();
            Console.WriteLine(new string('-', 50));
            classRoom.Read();
            Console.WriteLine(new string('-', 50));
            classRoom.Write();
            Console.WriteLine(new string('-', 50));
            classRoom.Relax();
        }
コード例 #3
0
        static void Main()
        {
            Student s1 = new GoodStudent();
            Student s2 = new BadStudent();
            Student s3 = new ExcelentStudent();
            Student s4 = new Student();

            ClassRoom group = new ClassRoom(s1, s2, s3, s4);

            group.Study();
            Console.WriteLine(new string('-', 30));
            group.Read();
            Console.WriteLine(new string('-', 30));
            group.Write();
            Console.WriteLine(new string('-', 30));
            group.Relax();

            Console.ReadKey();
        }