JShell to Improve Your Java Skills
JShell is quite late to the party, as scripting languages like Python and Node introduced similar utilities years ago, and JVM languages like Scala, Clojure, and Groovy followed in their footsteps. But better late than never.
Before the introduction of JShell, there was no way one could do REPL (Read-Evaluate-Print-Loop) in Java. A REPL is a simple, interactive programming environment that takes user input (Read), executes the user command (Evaluate), returns the result to the user (Print) and waits for the next user input (Loop).
In fact, to even print a single statement in the console it was absolutely necessary to at least have a class and the main method in it. JShell attempts to take away that pain to a certain extent and adds a full-fledged REPL feature in the Java programming language. JShell is an interactive tool that is useful to learn Java language features, APIs and allows quick prototyping, debugging without the need for full-fledged classes. Together with Java 10’s var keyword, JShell provides an excellent prototyping and learning environment.
It makes it easier to understand the code in everyday work, verification. It let us play with the code, experimentation ect.
References: Oracle JShell Documentation
Comments
Post a Comment