java9 gadget jshell

1.jshell gadget introduced jdk9

2. Start jshell

At the command line, type jshell

 

3. Use jshell

Such as defining a = 10; b = 20; a + b the output results, the following two methods

Method 1: code written in one line, a direct output of the transport

 Method 2: Write the code line by line, each completed row of transport continue to write one line

4. Exit jshell

Enter / exit

Guess you like

Origin www.cnblogs.com/liuyang-520/p/12051394.html