How to run a highlighted code only in IntelliJ IDEA? Sometimes you don\'t need to run the whole file and wants to just run the some numbers of code. Are there any such choices i
It's possible to evaluate arbitrary expressions (Run | Evaluate Expression):
Run
Evaluate Expression
To evaluate a code fragment, click the Code Fragment Mode button and fill in the Code Fragment text box.
You can also use the Scratches feature.
Since version 15 Java scratches are runnable.