Hello world application in Kotlin

Kotlin Hello World Application

To get started open your editor and type the snippet of code below

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

in kotlin main is the entry point function of an application

fun keyword is used for declaring functions it acts like function does in JavaScript.

Compile your application into jar
kotlinc hello.kt -include-runtime -d hello.jar

Execute your application
java -jar hello.jar

If everything went well you should see "Hello World" output from your terminal

Comments