Hi guys
If you'd have a Bicycle and a Tricylce class it would make sense to let them inherit from a Cycle class. I'm tempted to make the numberOfWheels a property of the Cycle class. Or would you say it's so defining for a Bicycle to have two wheels you'd make it a property of the Bicycle and the Tricycle class and not of the Cycle class?
I began out with declaring it a property of Cycle. Unfortunately overriding it wasn't as obvious as I thought. I can of course make it happen in the super.init. Is this the best way to go?
Tx
If you'd have a Bicycle and a Tricylce class it would make sense to let them inherit from a Cycle class. I'm tempted to make the numberOfWheels a property of the Cycle class. Or would you say it's so defining for a Bicycle to have two wheels you'd make it a property of the Bicycle and the Tricycle class and not of the Cycle class?
I began out with declaring it a property of Cycle. Unfortunately overriding it wasn't as obvious as I thought. I can of course make it happen in the super.init. Is this the best way to go?
Tx