JShell for prototyping
Try Java expressions interactively without creating files.
Porównanie kodu
✕ Java 8
// 1. Create Test.java // 2. javac Test.java // 3. java Test // Just to test one expression!
✓ Java 9+
$ jshell jshell> "hello".chars().count() $1 ==> 5 jshell> List.of(1,2,3).reversed() $2 ==> [3, 2, 1]
Widzisz problem z tym kodem? Daj nam znać.
Dlaczego nowoczesne podejście wygrywa
Instant feedback
Type an expression, see the result immediately.
No files needed
No .java files, no compilation step.
API exploration
Tab completion helps discover methods and parameters.
Stare podejście
Create File + Compile + Run
Nowoczesne podejście
jshell REPL
Od JDK
9
Poziom trudności
Początkujący
Wsparcie JDK
JShell for prototyping
Dostępne
Widely available since JDK 9 (Sept 2017)
Jak to działa
JShell is a Read-Eval-Print Loop for Java. Test expressions, experiment with APIs, and prototype code without creating files, compiling, or writing a main method. Tab completion and inline docs included.
Powiązana dokumentacja