A beginner-friendly introduction to the Kotlin programming language. If you have no programming background, start here β the lessons begin from the very first line of code.
This project uses Kotlin 2.4.20, the Gradle Kotlin DSL, and a Java 21 toolchain.
- Open source: The Kotlin compiler, IDE plugins, and build tools are open source.
- Interoperable: Kotlin is designed to work with Java. Existing Java and Android code can call Kotlin, and the other way around.
- Easy to learn: The syntax is concise, especially if you already know Java.
- Concise and expressive: Kotlin programs are typically shorter than the equivalent Java.
- Tool-friendly: Kotlin is developed by JetBrains, the company behind IntelliJ IDEA and Android Studio.
- Large community: Kotlin is used across Android, backend, and multiplatform projects, with a growing ecosystem.
- Safer code: Null safety, smart casts, and compiler checks catch many mistakes before you run the program.
- Multiplatform: You can share Kotlin code across Android, iOS, backend, desktop, and web targets.
- First-class Android support: Android Jetpack, KTX, and Coroutines are built around Kotlin language features.
- Mature toolchain: Since 2011, Kotlin has grown into a full ecosystem. The K2 compiler (Kotlin 2.x) is the default.
You need JDK 21 or newer. The Gradle Wrapper downloads Gradle 9.7.1 for you.
# Compile every lesson
./gradlew compileKotlin
# Run the Hello World lesson (default)
./gradlew run
# Run any other lesson by file name (without .kt)
./gradlew runLesson -Plesson=Variables
./gradlew runLesson -Plesson=DataTypes
./gradlew runLesson -Plesson=String
./gradlew runLesson -Plesson=TypeConversions
./gradlew runLesson -Plesson=Arrays
./gradlew runLesson -Plesson=ArrayList
./gradlew runLesson -Plesson=Set
./gradlew runLesson -Plesson=HashSetYou can also open the project in IntelliJ IDEA and run the main() function in any lesson file.
If this project helps you, you can buy me a cup of coffee.
- https://kotlinlang.org/docs/getting-started.html
- https://kotlinlang.org/docs/home.html
- https://developer.android.com/kotlin
- https://play.kotlinlang.org/
This project is licensed under the MIT License.


