Kotlin

Updated: 2021-11-28

Main class?

Suppose HelloWorld.kt has the following code, the main() is not in a class, what is the "main class"?

package com.example

fun main() {
    println("Hello, World!")
}

It turns out that the compiler wraps it in a class, and the main class is com.example.HelloWorldKt.