O'Reilly logo

Java 9 Cookbook by Nick Samoylov, Mohamed Sanaulla

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

JEP 222: 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required