JShell Tutorial


The JShell tool is a command line tool that facilitates exploratory programming by providing interactive use of Java Programming Language elements. JShell is a REPL (Read-Evaluate-Print-Loop). It is ideal both for learning the Java language and exploring unfamiliar code (include new Java APIs). Typical Java development means writing a complete program, then compiling it (fixing any errors), the running it, figuring out what is wrong, editing, and repeating. With JShell you can enter program elements one at a time, immediately seeing the result and adjusting accordingly. During development, code can be pasted into JShell, and/or working code pasted from JShell into a program editor …

More at https://cr.openjdk.org/~rfield/tutorial/JShellTutorial.html