Share your repls and programming experiences

← Back to all posts
My code does not work after being transferred to replit
h
luseufert5 (2)

I coded this in Eclipse but for some reason, it is throwing out random errors on Repl.it that it did not have when on Eclipse

Comments
hotnewtop
Klokat (42)

This is a bit of a weird one because repl.it doesn't allow you to rename Main.java. And that's the problem since in java your file name has to be the same as your class name. In your case your class name is Input so your file name should be Input.java. What you could do is change your class name to Main and it should run. Or you could create a new file called Input.java paste your code and then within Main.java have something like this:

class Main {
  public static void main(String[] args) {
    Input.main(args);
  }

Hope this helps. Cheers