static void Main(string[] args) { // Create a jet plane var jetEngine = new JetEngine(); var fokker = new Plane(jetEngine); fokker.Start(); // Create a Propeller plane var propellerEngine = new PropellerEngine(); var cessna = new Plane(propellerEngine); cessna.Start(); }
static void Main(string[] args) { // Create a jet plane, the default var fokker = new Plane(); fokker.Start(); // Create a Propeller plane var cessna = new Plane(); var propellerEngine = new PropellerEngine(); cessna.Engine = propellerEngine; cessna.Start(); }