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

Popular posts from this blog

How to make a html5 breakout game in JavaScript

How to tabulate array key values using console.table

How to set content disposition headers for express nodejs apps

Ways of iterating Object properties in JavaScript

How to evaluate a string on a regular expression rule in JavaScript