0

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

Sriram M
  • 482
  • 3
  • 12

1 Answers1

1

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:

enter image description here

Naman
  • 27,789
  • 26
  • 218
  • 353