My output keeps saying Hello World with every code.

For some reason no matter what type of code i do it only returns with hello world. How do i fix it?

public class EscapeSequences {
  public static void main(String[] args) {
    char firstLetter = 'A';
    char lastLetter = 'Z';
    char newLine = '\n';
    System.out.println(firstLetter);
    System.out.print(lastLetter);
  }
}

This is my code and this is what i get

 sh -c javac -classpath .:target/dependency/* -d . $(find . -type f -name '*.java')
 java -classpath .:target/dependency/* Main
Hello world!
 

https://replit.com/@DekuTodoroki/DirtyPlayfulComputer?v=1

Hey @DekuTodoroki!

You have renamed theMain.java file in ModulusPlaceValue.java. But the start button in Replit launches only the file that is registered in the .replit file (for Java, it is standard Main.java).

You can rename the ModulusPlaceValue.java file in Main.java, or configure the .replit file to run the ModulusPlaceValue.java file.


How to configure the .replit file:

Just click the next to “Files” then click “Show hidden files”. Next click on the .replit file and finally you can change the entrypoint to whatever file you want to run.

Images

Dots

Show hidden files

edited

You should also see the docs on how to configure a Repl: https://docs.replit.com/programming-ide/configuring-repl

And if you want to run the last edited file, take a look at this post:

1 Like

too busy rn but if you want to make that code work for Java you’d have to edit this bit (that is, if you can understand it…)

3 Likes