Loading...
Loading...
Loading...
Free, no sign-in
Write Java code, add input if your program reads any, and press Run. Java 21, in your browser.
Press Run (or Ctrl+Enter) to see the output here.
What it supports
Input
Programs that read from the keyboard get their input from the Input box. Type one value per line, then press Run. The program reads the lines in order, just as it would from a keyboard.
Scanner sc = new Scanner(System.in); int n = sc.nextInt(); // first value String word = sc.next(); // next word String line = sc.nextLine(); // rest of the line
Tip: if the output is empty or the run stops after 5 seconds, the program may be waiting for input that is not in the box.
Questions
Learn
This compiler is the same editor the Java course uses for its practice problems.
Looking for another language? Try the online Python compiler.