Skip to content
Sign UpLog In
Profile icon

Tauseef Kamal

Hacker
@tkamal
  • antsmashtest

    Cover page
    Made with HTML, CSS, JS
    Recent comments (0)
Repls
Community
tkamal
tkamal
shared a Post
4 years ago
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
VictoriaMaria2
VictoriaMaria2
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 Exercise102 years ago
timmy_i_chen
timmy_i_chen
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); `4 years ago