Run Java program different a different name - other than Main.java
Right now it seems Java programs can only run if you have a file name Main.java - if you have other files in the folder with a different name Program.java etc these Java file cannot run?
Is there a way to get over this issue?
If I understand your problem well, the case is this: the other programs in java can be executed, but they need to be compiled, if you do it through a program called Exercicio10.java you need to type javac Exercicio10.java, when compiling type after java Exercise10
There's no way to change which file is executed; however, you can instantiate other classes in the same directory. E.g. if I have
Car.java in the same directory as
Main.java I can just do:
Car c = new Car(args);