static void Main(string[] args) { PrinterCreater printerCreater = null; printerCreater = new Canon("Canon"); printerCreater.PrintMethod(); printerCreater = new HP("HP"); printerCreater.PrintMethod(); Console.ReadKey(); }
static void Main(string[] args) { Printer printer = new Canon("принтер Canon"); Paper paper1 = printer.Create(); printer.Print(paper1.Type); printer = new HP("принтер HP"); Paper paper2 = printer.Create(); printer.Print(paper2.Type); Console.ReadLine(); }