Exemplo n.º 1
0
 private static void PrintUsingStaticPolymorphism()
 {
     Console.WriteLine("Printing using static polymorphism:\n");
     CurrencyPrinter.PrintCurrency <Euro>();
     CurrencyPrinter.PrintCurrency <PoundSterling>();
     CurrencyPrinter.PrintCurrency <UsDollar>();
 }
Exemplo n.º 2
0
 private static void PrintUsingDynamicPolymorphism()
 {
     Console.WriteLine("Printing using Dynamic Polymorphism\n");
     _currency = new Euro();
     CurrencyPrinter.PrintCurrency(_currency);
     _currency = new PoundSterling();
     CurrencyPrinter.PrintCurrency(_currency);
     _currency = new UsDollar();
     CurrencyPrinter.PrintCurrency(_currency);
 }