Kotlin first programs with null safety

8 steps · about 3 h 40 min · Beginner

  1. Run your first Kotlin lines (tutorial, JetBrains (Kotlin docs), 15 min)

    Start with println, val and var so the rest of the language has a working base.

  2. Let the compiler infer types (tutorial, JetBrains (Kotlin docs), 15 min)

    See which basic types exist and when an explicit type annotation actually helps.

  3. Branch with when and loop over ranges (tutorial, JetBrains (Kotlin docs), 25 min)

    Kotlin's when expression and ranges replace most switch statements and index loops.

  4. Hold data in lists, sets and maps (tutorial, JetBrains (Kotlin docs), 25 min)

    Learn the read-only versus mutable split early, before it surprises you in real code.

  5. Write functions and lambdas (tutorial, JetBrains (Kotlin docs), 30 min)

    Default arguments, single-expression functions and lambdas make up most everyday Kotlin.

  6. Model data with classes and data classes (tutorial, JetBrains (Kotlin docs), 25 min)

    Data classes give equality and copying for free, so you can model records in one line.

  7. Handle missing values safely (tutorial, JetBrains (Kotlin docs), 25 min)

    Safe calls and the Elvis operator are the feature that sets Kotlin apart; practise them on real cases.

  8. Drill the basics with Kotlin Koans (interactive, JetBrains (Kotlin Playground), 1 h)

    Short in-browser exercises confirm each idea sticks before you start a project.