/! is used to run last Executed Statement.
Step 1: Open terminal and execute the command jshell.
$jshell
| Welcome to JShell -- Version 10.0.2
| For an introduction type: /help intro
jshell>
Step 2: Execute below statements.
System.out.println("Hello")
System.out.println("***********")
jshell> System.out.println("Hello")
Hello
jshell> System.out.println("***********")
***********
Step 3: Execute the command /! To re run last Executed statement.
jshell> /!
System.out.println("***********")
***********
This post first appeared on Java Tutorial : Blog To Learn Java Programming, please read the originial post: here