Hi,
This is how it work:
1. You write a
java Program
2. Compile it using javac yourprogram.java
When you compile it , java compiler is generating a byte code (just 0's and 1's) from the program you have written in java.javac generates a class file, which is used for running
3. Then you actually run it by java yourprogram
Compiler error means, this is not able to gnerate a .class file because the program you have written is not legal or syntax you have used is not allowed in the language
In java top class can only be public, so it is giving you compiler error.
For details see RHE book
HTH
Praveen