IntelliJ IDEA knows scratch files and scratch buffers.
This menu show the search action result:

Both scratch types show up under the Scratches and Consoles tree entry:

What is the difference between scratch file and scratch buffers?
When should I choose one over the other?