简体   繁体   中英

JShell - prevent enter key to execute Java statement or How to set statement delimiter

I'm practicing Java APIs in JShell prompt(feature added as part of Java 9).

Is there a way to customize or set custom statement terminator (generally ; in java). Because as soon as I hit ENTER key, the Java statement got executed in JShell prompt.

Please assist me

If the intention is to execute a block of code, you can choose to start your code with a curly brace { and then close it with } as well. A pictorial representation:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM