Creating a Kotlin class

To create a new Kotlin class, right-click on the folder and choose New | Other, as shown in the following screenshot:

Choose class, as shown in the following screenshot:

Give your new Kotlin class a name (HelloWorld) and a package (com.mastering.spring.kotlin.first). Click on Finish.

Create a main function, as shown in the following lines of code:

    fun main(args: Array<String>) {      println("Hello, world!")    }

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.