I don't know why you made a second class in this example. You can have a main method in any class. It will only run if you try to run this class or explicitly call it.


I see 2 errors with your code.

#1) You can have multiple classes in one file. You can't, however, have more than one public class in the same file. The file also has to have the same name as the public class.

#2) When you are trying to output the text, you are trying to reference a variable that doesn't exist - gears. You have a variable called gear.