From the course: IntelliJ IDEA Community Edition Essential Training

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Store code in scratch files

Store code in scratch files

From the course: IntelliJ IDEA Community Edition Essential Training

Start my 1-month free trial

Store code in scratch files

- There might be times when you need to temporarily store some code in a file that isn't part of the current project. IntelliJ IDEA lets you create scratch files, code files that are associated with a particular language but are stored as part of your user profile rather than as a part of the project. To create a new scratch file, go to the menu and choose file, new, scratch file. Next, select the language or platform that you want to associate the file with. I'm going to create one that's associated with Java. You get a class named Scratch, and you can pretty much ignore that, and then you can add whatever code you want to this file. I'll go back to my class. Right now, it's called PersonObject, but it could be anything, and I'll scroll down here. And I'm just going to make a copy of this toString method. I'll copy it and I'll paste it and I'll place it here as a member of this class. Now, this method doesn't really…

Contents