posted 12 years ago
There is a difference between a class and a method.
In you original post, you have:
Since your JavaApplication3 class is coderanch, it must be in a file named "JavaApplication3 .java"
Now...INSIDE your JavaApplication3 class (which means everything from line 04 to 27), you declare an addition robot class:
Your robot class is defined INSIDE of your JavaApplication3 class - that is what is called an inner class, because it is inside another class.
Your main method is also inside your JavaApplication3 class, but outside of the robot class.
You can move the robot class OUTSIDE of the JavaApplication3 class, but still keep it in the same file. However, the main method must be kept inside the class, and more specifically, inside the class you pass to java with the "java <classname>".
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors