Run Java program different a different name - other than
tkamal (4)

Right now it seems Java programs can only run if you have a file name - if you have other files in the folder with a different name etc these Java file cannot run?
Is there a way to get over this issue?

You are viewing a single comment. View All
timmy_i_chen (1098)

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 in the same directory as I can just do:

Car c = new Car(args);
AideOropeza (0)

@timmy_i_chen that doesn't work for me :(

timmy_i_chen (1098)

@AideOropeza Can you link me to a repl where you are trying to do it?

tianyw (1)

hi, there is a repl example. @timmy_i_chen

how to run the directly?