Do you have both the .class files and the java files in the same folder?
Test.java, Test.class, Menu.java, Menu.class ? I checked the code and it is correct.
The difference is that I have declared a package. The code should work without one. But is is better to use one. The right way would be to declare a package and set to the classpath the location of that package.
Can you verify at least that all of the above files mentioned are in the same folder?
javaAddict
Nearly a Senior Poster
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448
Have you tried to declare a package at those classes?
Don't forget to set the classpath as well. There are instructions you can follow. Look at the tutorials at the top of the java forum
javaAddict
Nearly a Senior Poster
3,329 posts since Dec 2007
Reputation Points: 1,014
Solved Threads: 448