static void Main(string[] args) { printable p = new PrinterProxy("Alice", "Printer"); Console.WriteLine("现在的名字是" + p.getPrinterName() + "。"); p.setPrinterName("Bob"); Console.WriteLine("现在的名字是" + p.getPrinterName() + "。"); p.Print("Helle,world."); }
static void Main(string[] args) { IPrintable p = new PrinterProxy("Alice"); Console.WriteLine("名前は現在" + p.GetPrinterName() + "です。"); p.SetPrinterName("Bob"); Console.WriteLine("名前は現在" + p.GetPrinterName() + "です。"); p.Print("Hello, world."); }
static void Main(string[] args) { IPrintable iPrintable = new PrinterProxy("佐藤"); Console.WriteLine($"名前は現在{iPrintable.GetPrinterName()}です。"); iPrintable.SetPrinterName("田中"); Console.WriteLine($"名前は現在{iPrintable.GetPrinterName()}です。"); iPrintable.Print("Hello World!"); }