Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ IDEA run highlighted code only

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 in IntelliJ IDEA?

like image 545
malhajri2017 Avatar asked Nov 21 '25 07:11

malhajri2017


1 Answers

It's possible to evaluate arbitrary expressions (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.

like image 198
CrazyCoder Avatar answered Nov 23 '25 14:11

CrazyCoder



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!