IntelliJ IDEA run highlighted code only

后端 未结 1 1583
谎友^
谎友^ 2021-01-21 08:02

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

1条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-21 08:50

    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.

    0 讨论(0)
提交回复
热议问题