Now we have a
Sedan class and
Truck class that implement the
IAutomobile interface. Though they have some different behaviors, they both have the properties and method defined in the interface:
At this point we can be confident that we won’t cause any errors if we try to access these members in either the
Create two sedans and a truck:
- a sedan with speed 60
- a sedan with speed 70
- a truck with speed 45 and weight 500
Console.WriteLine() statements that print the automobiles’
SpeedUp() on all three automobiles.
Console.WriteLine(), print out the three automobile’s new speeds.