Esempio n. 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);
 }
Esempio n. 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);
     }
 }