Kotlin for beginner - Part one (Setup):
Kotlin was developed by JetBrains, the company behind different popular products like IntelliJ IDEA, PyCharm, RubyMine etc. They have started it in July 2011, but the first official stable release was on Feb 15, 2016(Kotlin V1.0). Kotlin is an opensource project under Apache 2 license. On Google IO 2017, Google has announced full Kotlin support for Android development and starting Android Studio 3.0, kotlin is included in the Android Studio by default. You can even run kotlin code along with Java code. This is our first post on kotlin. In this tutorial, we will learn the basics of Kotlin language, how to setup and how to run a simple program. Let’s take a look :
What development IDE to use for Kotlin?
Different IDE is available for Kotlin. You can use any one of them or use the one you use regularly. We are not going to discuss in details about the installation because it is different for different IDEs and it may change in the future. You can check the official installation guide for more details. You can use any one of the following IDE for kotlin development :
We are going to use IntelliJ IDEA for our tutorials. The main reason is that we have a future plan to write Android development tutorials using kotlin and since the Android studio is developed on IntelliJ, it will be easier for you to pick up.
How to create a simple “Hello World” application on Kotlin using IntelliJ IDEA :
- First of all, download the IntelliJ IDEA from the link above, install and run it. One new window will open, click on “Create new project” and select the option Kotlin/JVM on that window :
fun main(args: Array) {
}
Now, write one println() method with Hello world !! as its argument string :
fun main(args: Array) {
println("Hello world !!")
}