← Back to Community
How to use 2 classes in java?
Profile icon
blakejoseph

Trying to get Odometer class and sample1 class to both work. I can name one main but it still wont work for the second class. Can anyone help with this?

Voters
Profile icon
blakejoseph
Comments
hotnewtop
Profile icon
Coder100

You are doing it wrong. Odometer class is in the right place, Odomoter.java. Now, Main.java, your entry point is non existant. So create a main.java file and add:

public class Main { // whatever code }