Writing the main function

Kotlin Native has the same language syntax and includes the standard library. Hence, the main function in Kotlin Native looks the same as the main function in JVM or JS. It is similar to the following syntax:

    // Starting point    fun main(args: Array<String>) {      // Rest of code over here..    }

The main function takes args, which contains the arguments from the command line.

Get Kotlin Blueprints 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.