[Solved] I’m writing my first ever java program and it’s not compiling for a certain reason [duplicate]
basically the compiler tells you whats wrong. It says, “class main is public, should be declared in a file named main.java”. Java has a naming rule, that a class inside a java file needs to match that file name. Example 1: Filename -> File.java inside that file: public class Main{ … does violate that rule … Read more