Exemple #1
0
 internal static void Main(string[] args)
 {
     Student s = new Student();
     Teacher t = new Teacher();
     s.failedHandler += t.RemindFailure;
     s.Grade = 0;
 }
Exemple #2
0
 static void Main(string[] args)
 {
     string sub;
     Person p1 = new Person();
     p1.Message();
     Student s1 = new Student();
     s1.SetAge(21);
     s1.Message();
     s1.ShowAge();
     Teacher t1 = new Teacher();
     t1.SetAge(30);
     t1.Message();
     t1.ShowAge();
     Console.WriteLine("Enter the subject:");
     sub = Console.ReadLine();
     t1.SetSub(sub);
     t1.Explain();
     Console.Read();
 }