Ask coding questions

← Back to all posts
How to use 2 classes in java?
blakejoseph (0)

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?

Comments
hotnewtop
Coder100 (18882)

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
}