That message says what the problem is. The code for the class should be in a file named: main.java
The filename and the public class name need to be the same.
Note: Java naming conventions say...
Type: Posts; User: Norm
That message says what the problem is. The code for the class should be in a file named: main.java
The filename and the public class name need to be the same.
Note: Java naming conventions say...
What happened? Can you copy the full text of any error messages and paste it here so we can see?
Please edit your post and wrap your code with code tags:
**YOUR CODE GOES HERE**
to...
You need a JDK that contains the javac program to compile the .java file to create a .class file.
Then execute the .class file with the java program.
For example:
javac MyCode.java
java MyCode