Skip to content
BENIBIX Learn

Kotlin

Development🔤 LanguagesPopular Languages

A newer language that runs side by side with Java. The top pick for Android apps.

Think of it like

Think of it like a newer model of a trusted bike. Same frame and parts fit, but the ride is smoother.

Example

Google named Kotlin the first choice for Android in 2019. A team in Berlin then moves its app over, file by file.

Why it matters

Anyone building for Android today will meet Kotlin. It also runs on servers and in shared mobile code.

Definition

Kotlin is a modern language that runs on the same JVM as Java. It works side by side with Java code, so teams can switch one file at a time. It needs less code than Java for the same job and guards against null mistakes. It is free to use and open source. Most new Android apps are now written in Kotlin.

Example code

kotlin
fun main() {
    println("Hello, world!")
}
Shorter than the Java version, and it runs on the same machine.

Common mistake

Thinking you must rewrite all Java code first. Kotlin and Java live happily in one project.

Key takeaways

  1. 1
    Works with Java. Both run on the JVM together.
  2. 2
    Less code. The same job takes fewer lines.
  3. 3
    Null-safe. It checks for empty values before running.

Learn it properly