Hello everyone!
I have decided to finally start learning Java and am currently, and slowly, making my way through the tutorials. I am only on chapter 2 in the class section. While reading I came uponJava Tutorials Sample Code and wanted to try and compile it in netbeans. This is the code that it contained:
class
BicycleDemo {
public
static
void
main(String[] args) {
Bicycle bike1 =
new
Bicycle();
Bicycle bike2 =
new
Bicycle();
bike1.changeCadence(
50
);
bike1.speedUp(
10
);
bike1.changeGear(
2
);
bike1.printStates();
bike2.changeCadence(
50
);
bike2.speedUp(
10
);
bike2.changeGear(
2
);
bike2.changeCadence(
40
);
bike2.speedUp(
10
);
bike2.changeGear(
3
);
bike2.printStates();
}
}
I did the following in order:
1) New project
2) Select Java under Categories and Java Application under Projects
3) I type BicycleDemo in the Project Name Field and click finish
4) I delete all the template code and paste the above code into the field
5) I click run and get the following error:
run:
Error: Could not find or load main class bicycledemo.BicycleDemo
Java Result: 1
BUILD SUCCESSFUL (total time: 0 seconds)
Any help would be greatly appreciated! Thanks!