Okay, I'm pretty new to java, just learning about classes and objects.
So I have a super class: bicycle
Here they are:
public class Bicycle
public int speed;
public int gear;
public Bicycle(int startSpeed, int startGear)
speed = startSpeed;
gear = startGear;
public void changeSpeed(int newSpeed)
speed = newSpeed;
public void changeGear(int newGear)
gear = newGear;
public class MountainBike extends Bicycle
private int chairHeight;
public MountainBike(int newChairHeight)
chairHeight = newChairHeight;
When attempting to compile MountainBike, i get:
constructor bicycle in class bicycle cannot be applied to given types
required int int, found no arguments
What arguments do I need?
How do i make it work :s
Noob question I know.
Finally, lets say I have another subclass called roadbike.
I can't have a userinterface class that extends both roadbike and mountainbike.
Like, lets say the userinterface asks, "which bike do you want to ride?"
well i mean... how do you do it?