Beispiel #1
0
 static void PrintPensionAmount(PublicServant servant)
 {
     if (servant is Firefighter)
         Console.WriteLine("Pension of firefighter: " + servant.PensionAmount);
     else if (servant is PoliceOfficer)
         Console.WriteLine("Pension of officer: " + servant.PensionAmount);
 }
Beispiel #2
0
 static void PrintPensionAmount(PublicServant servant)
 {
     if (servant is Firefighter)
     {
         Console.WriteLine("Pension of firefighter: " + servant.PensionAmount);
     }
     else if (servant is PoliceOfficer)
     {
         Console.WriteLine("Pension of officer: " + servant.PensionAmount);
     }
 }