Пример #1
0
        static void Main(string[] args)
        {
            Person person  = new Person();
            Person student = new Student();
            Person teacher = new Teacher(30);

            person.SayHello();
            student.SetAge(21);
            student.SayHello();
            student.ShowAge();
            teacher.SayHello();
            teacher.Explain();
        }
Пример #2
0
        static void Main(string[] args)
        {
            Person p = new Student();

            p.SayHello();

            Student s1 = new Student();

            s1.SetAge(21);
            s1.SayHello();
            s1.ShowAge();

            Teacher t = new Teacher();

            t.SetAge(30);
            t.SayHello();
            t.Explain();
        }