Description #
Kotlin is a modern, statically typed programming language that runs on the Java Virtual Machine (JVM). It’s designed to be fully interoperable with Java while offering a cleaner, more concise syntax and many improvements in safety and tooling.
History #
Kotlin was developed by JetBrains and released in 2011 as an alternative to Java. It became officially supported by Google for Android development in 2017 and was later named the preferred language for Android apps. Kotlin has since grown in popularity due to its elegant syntax, null safety, and compatibility with Java libraries and tools.
Hello World Code #
fun main() {
println("Hello, World!")
}
How to Run #
Option 1: Online
Option 2: Local
Install IntelliJ IDEA or use Kotlin via command line.
Save as hello.kt
and run:
kotlinc hello.kt -include-runtime -d hello.jar
java -jar hello.jar
Key Concepts #
- Statically typed
- Compiles to JVM bytecode
- Fully interoperable with Java
- Null safety with
?
and!!
- Extension functions
- Coroutines for async tasks
- Concise syntax
- Default arguments and named parameters
- Smart casting
- Multi-platform support (JVM, JS, Native)
Try It Online #
Fun Facts #
- Kotlin’s name comes from Kotlin Island, near St. Petersburg, Russia (like Java was named after an island).
- Kotlin is used in over 80% of the top Android apps.
- JetBrains, the creators of IntelliJ IDEA, built Kotlin to improve their own productivity.