static void Main(string[] args) { try { FiestaPrototype prototipoFiesta = new FiestaPrototype(); CarroPrototype palioNovo = prototipoFiesta.clonar(); palioNovo.setValorCompra(27900.0); CarroPrototype palioUsado = prototipoFiesta.clonar(); palioUsado.setValorCompra(21000.0); Console.WriteLine(palioNovo.exibirInfo()); Console.WriteLine(palioUsado.exibirInfo()); } finally { Console.ReadKey(); } }
public static void EX1() { CarroPrototype prototype = new FiatPrototype(); prototype.ViewInfo(); CarroPrototype carroAntigo = prototype.Clonar(); carroAntigo.Ano = "2005"; carroAntigo.ValorCompra = 10000; carroAntigo.ViewInfo(); prototype = new FordPrototype(); prototype.ViewInfo(); carroAntigo = prototype.Clonar(); carroAntigo.Ano = "2005"; carroAntigo.ValorCompra = 9000; carroAntigo.ViewInfo(); }