25.3 Introduction to JShell
[Note: This section may be read after studying Chapter 2, Introduction to Java Applications; Input/Output and Operators.]
In Chapter 2, to create a Java application, you:
-
created a class containing a
main
method. -
declared in
main
the statements that will execute when you run the program. -
compiled the program and fixed any compilation errors that occurred. This step had to be repeated until the program compiled without errors.
-
ran the program to see the results.
By automatically compiling and executing code as you complete each expression or statement, JShell eliminates the overhead of
-
creating a class containing the code you wish to test,
-
compiling the class and
-
executing the class.
Instead, you can focus ...
Get Java How to Program, Early Objects, 11th Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.