2018-10-19

Java 9 : jshell -- the Java shell (Read- Eval-Print Loop)

You must have seen languages, such as Ruby, Scala, Groovy, Clojure, and others shipping with a tool, which is often called REPL (Read-Eval-Print-Loop). This REPL tool is extremely useful in trying out the language features. For example, in Scala, we can write a simple
Hello World
program as
scala> println("Hello World");

Some of the advantages of the JShell REPL are as follows:

  • Help language learners to quickly try out the language features
  • Help experienced developers to quickly prototype and experiment before
  • adopting it in their main code base
  • Java developers can now boast of an REPL

Let's quickly spawn our command prompts/terminals and run the JShell command,
as shown in the following image:



No comments:

Post a Comment