JDK 9 New Feature : Much Awaited JShell (REPL for Java) Review

Опубликовано: 07 Октябрь 2024
на канале: Genuine Coder
3,127
34

REPL means Read-Eval-Print Loop which can be used to execute simple instructions interactively like we see in scripting languages like Python and Bash.

JShell is included in the official JDK 9 and current beta build (9 Build 135) comes with it. You can access JShell from bin/jshell. You can download the latest version of Java Development Kit from https://jdk9.java.net/download/.

You can always get the help by typing /help in JShell. JShell provides support to make simple experssions like 2+2 or 5+5*5 etc. The result of this expression will be stored in a variable starting with $ symbol.

JShell also supports defining classes and methods. /history can be used to see the previously executed instructions


Genuine Coder
http://www.genuinecoder.com/