What is Kotlin?
What Kotlin is, why Google made it Android's preferred language, and where else it shows up today.
2 phút đọc
Kotlin is a modern, statically-typed programming language created by JetBrains (the makers of IntelliJ IDEA) and first released in 2011. It runs on the Java Virtual Machine, which means it can call Java code and be called by Java code with almost no friction — you can drop a single Kotlin file into an existing Java project and it will just compile alongside everything else.
That interop is exactly why Kotlin took off. In 2017, Google made it an officially supported language for Android, and by 2019 declared it Android's preferred language — ahead of Java. Millions of lines of existing Android code were written in Java, so a new language only had a chance if it could sit next to that code without a rewrite. Kotlin does.
What problem it actually solves
Kotlin was designed by engineers who were tired of writing the same defensive boilerplate in Java — null checks, getter/setter ceremony, verbose anonymous classes. Kotlin keeps Java's strengths (a fast, garbage-collected, statically-typed runtime with a huge ecosystem) while cutting the ceremony:
// A "person with a name and age" in idiomatic Kotlin
data class Person(val name: String, val age: Int)
fun main() {
val alice = Person("Alice", 30)
println("${alice.name} is ${alice.age}")
}That single data class line generates a constructor, readable property access, toString(), equals(), and more — all things you'd hand-write in Java across a dozen lines.
Where Kotlin is used
- Android development — the primary reason most people learn Kotlin today. Every new Android API is designed Kotlin-first.
- Backend services — frameworks like Ktor (built by JetBrains itself) and full support in Spring Boot let you write server-side APIs in the same language as your Android app.
- Kotlin Multiplatform (KMP) — lets you share business logic (networking, data models, validation) across Android, iOS, web, and desktop, while each platform keeps its own native UI.
- General scripting and tooling — Gradle build scripts, for example, can be written in Kotlin (
build.gradle.kts) instead of Groovy.
A quick taste
Here's the same idea Java needs a public class and a main(String[] args) wrapper for, in Kotlin:
fun main() {
println("Hello, Kotlin!")
}No class wrapper required, no explicit void, no semicolons. It's a small example, but it previews a theme you'll see throughout this course: Kotlin tends to ask you to write less while expressing exactly as much.
The rest of this course focuses on the language itself — syntax, types, null safety, functions, and object-oriented features — so that whichever direction you take it (Android, backend, or multiplatform) you're standing on solid ground.