Print Statements Not Working Properly

Lately none of my print statements (for Java code) have been matching the output. I believe it is an issue with the Repl not recompiling? For example, in a completely new Repl, the only thing that ever seems to be printing out is the default “Hello World!” statement, even if the entire file is commented out. No print statements from any other files are being printed.
I have tried forcing the repl to recompile with no luck.
The code from both the main file and test file are below, it’s really nothing more than a single print statement in each which is why I’m so confused about why it’s not working… code (mind you this is the default code which has been commented out on my repl)

//class Main {
  //public static void main(String[] args) {
    //System.out.println("Hello world!");
//} code (has not been commented out and is the only other file with actual code, the others are just .txt files)
class Test {
  public static void main(String[] args) {
    System.out.println("An emergency Broadcast");

Again, all that is being printed out is “Hello World!”
This is an issue that is extending across all of my Repl’s, not just this specific one.

You need to copy the code from the other file into the main file.

Would you explain how you’re running the files?

Hey @teaganmann06 welcome to the forums!

You can change the file that is ran by first clicking on the 3 dots next to Files and click Show Hidden Files, then click on the .replit file and change the entrypoint = or run = to you Java file your want to run. Replit automatically runs the file and doing this will let you run other files that aren’t the main one. Hope this helps!

1 Like