//file Main.kt
class Person() {
fun greet() {
println("Hello");
}
}
fun main(args: Array) {
Person().greet()
}
In the example above I have created a file with extension kt and inside it I have added a class and the main function. In Kotlin, each class compiles to a separate .class, which gives me Person.class; plus, the main fun, which is not contained in any class, will generate a Mainkt.class
The Mainkt.class contains a public class named Mainkt with a public static method called main