Kotlin Hello World Program


Kotlin Hello World Program

In this tutorial, we will learn how to write a Hello World program in Kotlin language. We will go through each statement of the program.

Kotlin Program

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

Output

Hello, World!

Working of the "Hello, World!" Program

  1. fun main()
    This line defines the main function, which is the entry point of the program in Kotlin.
  2. {
    This opening brace marks the beginning of the main function's body.
  3. println("Hello, World!")
    This line prints the string "Hello, World!" to the standard output. The println function adds a new line after the text.
  4. }
    This closing brace marks the end of the main function's body.