Exemplo n.º 1
0
        public static void Main(string[] args)
        {
            Person person = new Person();

            person.SayHello();

            Person student = new Student();

            student.SetAge(_studentAge);
            student.SayHello();
            ((Student)student).ShowAge();

            Person teacher = new Teacher();

            teacher.SetAge(_teacherAge);
            ((Teacher)teacher).Subject = _teacherSubject;
            teacher.SayHello();
            ((Teacher)teacher).Explain();

            Console.ReadKey();
        }