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

Ways of iterating Object properties in JavaScript

JavaScript intro to classes

How to make a html5 breakout game in JavaScript

How to resume a suspended web audio api context

Animated daylight on HTML5 Canvas