Learning Java from the textbook by C. Sierra and B. Bates "Learning Java 2nd Edition 2012", there is an example of a program code consisting of three classes, all three classes have the prefix public, but when I rewrote the code and tried to run, the command line issued something like "the name of your public class must match the name of the file". Since the name of the file is one, and I have assumed three classes of classes that there can be only one public class. As a result, I left public only for the class with main. It worked, but now I don’t know if I was right about the fact that there can be only one public class in the program? But then, does this mean that there is a mistake in the textbook? Or I have some other Java, which has changed since the release of the textbook in 2012. I can attach screenshots from the textbook, if necessary.
I write the code in Notepad ++, I launch programs via the Windows command line, if that matters.
main()methodmain()entry point) is launched, the rest happens without your participation, the compiler will find the files it needs. - pavlofff