We value your feedback.
Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!
Then I'm told this vehicle is blue:
v = new Vehicle();
Then I'm told this vehicle is a motorcycle with chrome handlebars. My Motorcycle class is an extension of the base class Vehicle, but now I have to abandon my Vehicle class v and create an instance of Motorcycle:
v.Color = blue;
and copy over the color:
m = new Motorcycle();
This doesn't seem right. I shouldn't have to abandon my vehicle class v and start a new class m. Yet it wouldn't be appropriate to have a "handlebar" field in my Vehicle class.
m.Color = v.Color; m.handlebars = Chrome;