The Kotlin REPL
Sometimes you might want to test out a small bit of Kotlin code to see what happens when you run it, similar to how you might use a piece of scratch paper to jot down steps for a small calculation. This is especially helpful as you are learning the Kotlin language. Luckily for you, IntelliJ provides a tool for quickly testing code without having to create a file. This tool is called the Kotlin REPL. We will explain the name in a moment – for now, open it up and see what it can do.
In IntelliJ, open the Kotlin REPL tool window by selecting Tools → Kotlin → Kotlin REPL (Figure 1.14).
Figure 1.14 Opening the Kotlin REPL tool window
IntelliJ will display the REPL at the bottom of the window (Figure 1.15). ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access