Note 1.7.1. Java Note.
Java is a big language, and we can cover only some of its important parts in the next few pages. In the rest of the book, when there’s a Java construct that we haven’t covered yet, we’ll put it in a “Java Note” like this one.
jshell allows you to try out Java statements interactively without having to write a complete program. When you run jshell, it displays jshell> as its prompt and then evaluates the Java constructs you provide. For example,
jshell> System.out.println("Algorithms and Data Structures")
Algorithms and Data Structures
jshell> 12 * 144;
$1 ==> 1728
System.out.println function (which prints out its argument, followed by a newline), the result, and the next prompt.
$1 is a temporary variable created by jshell to hold the calculated value. If we were to evaluate another expression, it would be assigned to $2, and so on.