/reload command is used to reset and replay relevant history.
Step 1: Open terminal and execute the command jshell.
$jshell
| Welcome to JShell -- Version 10.0.2
| For an introduction type: /help intro
Step 2: Execute below statements.
System.out.println("line1")
System.out.println("line2")
System.out.println("line3")
jshell> System.out.println("line1")
line1
jshell> System.out.println("line2")
line2
jshell> System.out.println("line3")
line3
Step 3: Execute the command /reload to reexecute all the statements.
jshell> /reload
| Restarting and restoring state.
-: System.out.println("line1")
line1
-: System.out.println("line2")
line2
-: System.out.println("line3")
line3
No comments:
Post a Comment