Friday 8 January 2021

Jshell: /!: Re run last executed statement

/! 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("***********")
***********

 

 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment