The
Java compiler only allows one public class definition per file. The file name must match the name of the public class definition contained in the file (if a public class definition exists in the file). So, if you were to do as the error message suggested, your problem would likely be solved.
This construct allows the compiler to easily figure out what to do with a source file and the class file definitions. In other languages, such as C, it is my understanding that these rules are not enforced and so, when compiling, the programmer must also provide a make file that tells the compiler what to do. I may have understood that incorrectly as I've never programmed in C.