Using JShell with NetBeans

January 17, 2019 | 2 minute read
Text Size 100%:

By Guess Blogger Deepak Vohra 

Java Shell (or JShell) is a new tool introduced in Java 9 for running standalone code snippets.  JShell in NetBeans is explored in six articles. The first article introduces JShell with NetBeans including how to access the JShell.  JShell-only commands such as /list and /save are shell commands to facilitate the use of the tool.  The first article discusses how to run code snippets to import a package or a type. Further, the first article discusses declaring and using variables explicitly.

The second article continues with declaring and using variables; implicit variables. Further, code snippets for String comparison and statements are run in the second article. Resetting JShell is also discussed in the second article.

The third article is all about running code snippets for methods in JShell. Modifying method definition, method overloading, and making a forward reference to a method are discussed as used in JShell. Some JShell specific features for methods are also discussed including listing code snippets for methods, and method modifiers not permitted in a top-level method declaration.

The fourth article is mainly about running code snippets for classes in JShell including declaring a class, modifying a class, using class constructors, extending a class and overriding methods. Further, interfaces, arrays and unchecked exceptions are also discussed.

The fifth article discusses running code snippets for enums and the various control flow statements.

The sixth article discusses lambda expressions, in addition to discussing saving and loading code snippets in JShell.

Using JShell in Java 9 in NetBeans 9.0, Part 1

Using JShell in Java 9 in NetBeans 9.0, Part 2

Using JShell in Java 9 in NetBeans 9.0, Part 3

Using JShell in Java 9 in NetBeans 9.0, Part 4

Using JShell in Java 9 in NetBeans 9.0, Part 5

Using JShell in Java 9 in NetBeans 9.0, Part 6

Yolande Poirier

Yolande Poirier manages the online experience for the world's biggest IT community. She empowers developers to successfully grow their projects, businesses, and careers. Telling the story of how people use technology, she curates technical content, interviews IT professionals around the world, and write blogs about Java technologies and projects. She is a speaker at international conferences and JavaOne Rock Star, this year's track lead of the developer community day and a long time member of @jduchess, a network of women in Java. She manages @Java, a network of over 350,000 developer enthusiasts.


Previous Post

JDK 11.0.2, 8u201, 8u202(PSU), and 7u211 Have Been Released!

Clifford Wayne | 1 min read

Next Post


30 New Java Champions Confirmed in 2018

Vincent Mayers | 1 min read