Hello World program in Kotlin

In this article, you will learn how to print Hello World in Kotlin programming. Hello World is the simplest program in any programming language.

Source Code:
fun main(args: Array<String>)
    print("Hello World")
Hello World
Here, we are starting with the simplest program to introduce you to Kotlin programming language. Unlike the Java programming, Class declaration is not mandatory in Kotlin programming language. Kotlin compiler creates class internally.

In Kotlin programming, the main function is mandatory. The Kotlin program starts executing the program from the main function. Signature of the main method is fun main(args: Array<String>) {}.

print() function prints the message entered in double quotes. Where println() function prints the message in the new line.

Post a Comment