Kotlin – IntelliJ IDEA Hello World

Start Intellij and click Create new Project

, <span>Kotlin – IntelliJ IDEA Hello World</span>, KandZ

Select Kotlin from the left panel and then Kotlin/JVM from the right panel. Click Next.

, <span>Kotlin – IntelliJ IDEA Hello World</span>, KandZ

Specify a project name, location and everything else you need to. Click Finish.

, <span>Kotlin – IntelliJ IDEA Hello World</span>, KandZ

Expand Hello World, right-click src, select New and then Kotlin File/Class. This way you will create a new file at the src folder. You will see the following window. Specify the name and click OK.

, <span>Kotlin – IntelliJ IDEA Hello World</span>, KandZ

Type the following code:

fun main(args: Array<String>){
println("Hello World!!!")
}
, <span>Kotlin – IntelliJ IDEA Hello World</span>, KandZ

In Kotlin the main entry point is the main function.

The easiest way to run it is to press the green play button at the left of the fun. Then click Run HelloWorldKt. You will see the outpout at the bottom of the screen.

, <span>Kotlin – IntelliJ IDEA Hello World</span>, KandZ

42690cookie-checkKotlin – IntelliJ IDEA Hello WorldKotlin – IntelliJ IDEA Hello World

Related posts