25.16 Wrap-Up
In this chapter, you used JShell—Java 9’s new interactive REPL for exploration, discovery and experimentation. We showed how to start a JShell session and work with various types of code snippets, including statements, variables, expressions, methods and classes—all without having to declare a class containing a main method to execute the code.
You saw that you can list the valid snippets in the current session, and recall and execute prior snippets and commands using the up and down arrow keys. You also saw that you can list the current session’s variables, methods, types and imports. We showed how to clear the current JShell session to remove all existing snippets and how to save snippets to a file then reload them.
We demonstrated ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access