say I got this code here
if I pass int spd from blueBike to redBike it should give me an error. So how can I just pass one variable from blueBike to redBike? is that even possible? (redBike is expecting another method to pass to it the gear setting)
jo buger wrote:Im trying to pass some variable between classes, but it is not going to let me because of the "actual and formal argument lists differ in length"
say I got this code here
if I pass int spd from blueBike to redBike it should give me an error. So how can I just pass one variable from blueBike to redBike? is that even possible? (redBike is expecting another method to pass to it the gear setting)
jo buger wrote:say I got this code here...
I would certainly question that. I would suggest that colour is an attribute of a bicycle and creating BlueBike or RedBike classes is dubious to say the least.Winston Gutkowski wrote: . . . So: Given a red bike and a blue bike - which presumably are both subtypes of a Bike (although even that is open to question) - . . .
Campbell Ritchie wrote:
I would certainly question that. I would suggest that colour is an attribute of a bicycle and creating BlueBike or RedBike classes is dubious to say the least.Winston Gutkowski wrote: . . . So: Given a red bike and a blue bike - which presumably are both subtypes of a Bike (although even that is open to question) - . . .
RacingBike TouringBike TandemBike and MountainBike sound like better types of subclass.
Campbell Ritchie wrote:But are they red or blue?