11.5 Experimenting with Kotlin
When learning a new programming language, it is often useful to be able to enter and execute snippets of code. One of the best ways to do this with Kotlin is to use the online playground (Figure 11-1) located at https://try.kotl.in. In addition to providing an environment in which Kotlin code may be quickly entered and executed, the online playground also includes a set of examples demonstrating key Kotlin features in action.
The panel on the left-hand side (marked A in Figure 11-1) contains a list of coding examples together with any examples you create. Code is typed into the main panel (B) and executed by clicking the Run button (C). Any output from the code execution appears in the console panel (D). Arguments may be passed through to the main function by entering them into the field marked E.
Figure 11-1
Try out some Kotlin code by opening a browser window, navigating to the online playground and entering the following into the main...