Careeroza
Kotlin Study Material
What is Kotlin
What is Kotlin?
Kotlin is a modern, statically typed programming language created by JetBrains (the company behind IntelliJ IDEA and Android Studio). Version 1.0 came out in 2016. It runs on the Java Virtual Machine (JVM), so it can use every Java library, and it can also be compiled to JavaScript and to native code.
- Concise: the same logic usually needs 30–40% fewer lines than Java.
- Safe:
nullis part of the type system, so mostNullPointerExceptioncrashes are caught while compiling. - Interoperable: Kotlin and Java files can live in the same project and call each other.
- Multi-purpose: Android apps, backend servers (Spring Boot, Ktor), desktop apps and shared mobile code (Kotlin Multiplatform).
Hello, Kotlin
Example
Every Kotlin program starts at a top-level main function. No class is needed, and semicolons are optional.
fun main() {
println("Hello, Kotlin!")
println("Kotlin runs on the JVM")
}Output
Hello, Kotlin! Kotlin runs on the JVM
A Short History
| Year | Event |
|---|---|
| 2011 | JetBrains announces Project Kotlin (named after Kotlin Island near St. Petersburg) |
| 2016 | Kotlin 1.0 released |
| 2017 | Google announces official Kotlin support for Android |
| 2019 | Google declares Android development Kotlin-first |
| 2024 | Kotlin 2.0 with the new K2 compiler (much faster builds) |