Empty Main function

I read online that the Main function is the starting point of the program.

Is it possible to start a Kotlin program with an empty Main function, that is, fun Main(), & nothing else?

I’m intrigued about Kotlin & I’m eager to start learning it. I’ve already installed IntelliJ on my Mac.

Yep, perfectly valid. I just tested it to be sure.

fun main() {
}

YAY! Thank you.

I assumed that it is possible to have an empty Main function & it is!

I guess that sometimes it is necessary to have code in the Main function, but I’m glad that It is possible to have an empty main function. The Main function is the starting point of the program

I’ve tried different programming languages. I tried BASIC before it became Visual Basic. I tried Visual BASIC. I tried Turbo Pascal. I even tried Java. Java is so verbose! It reminds me of COBOL.

I researched JVM languages. I want a language that is 100% interoperable with Java. There aren’t too many. Scala has a steep learning curve & strange syntax. Boxlang is 100% interoperable with Java. I haven’t found much information on Boxlang. Kotlin fits the bill. It checks all of the boxes. I have a Mac. I installed IntelliJ on it. I have a book on programming in Kotlin. I’m learning Kotlin!

1 Like