Hi,
You have created and implemented correctly. The code would compile but when you run you won't get anything, since there is no main method. Whenever you try to run something JVM looks for public static void main(
String[] args){}. Unless you implement that, you won't get anything.
Add this as well,
public class RunBicycle{
public static void main (String [] args){
Bicycle b = new Bicycle();
// Now givimg new values to its class variables
b.changeCadence(5);
b.changeGear(6);
b.speedUp(7);
b.applyBrakes(3);
// Now printing the values
b.printStates();
}
}
NOTE: Save the file as RunBicycle.java and compile it as RunBicycle.java and execute as
java RunBicycle.
Thanks,
Dinesh