KtKotlin

Learn Kotlin – all lessons

16 lessons from beginner to advanced, building on each other and with code examples.

Beginner
1

Hello World & main

Your first Kotlin program, output, and comments.

2

Variables, Types & String Templates

val and var, type inference, number types, and text with values.

3

Conditions: if and when

if as an expression and the powerful when.

4

Loops & Ranges

for over ranges and collections, while, and breaking out with labels.

5

Functions

Default values, named arguments, vararg, and returning multiple values.

6

Lists, Sets & Maps

The basic Kotlin collection types – read-only or mutable.

Intermediate
7

Null Safety

Nullable types, safe call, Elvis, smart cast, and !!.

8

Classes, Properties & Interfaces

Primary constructor, properties, inheritance with open, and interfaces.

9

Data Classes, Enums & Objects

Data classes with copy, enum classes, singletons, and companion objects.

10

Extension Functions, Lambdas & Scope Functions

Extending existing types and using functions as values.

11

Collection Operations & Sequences

filter, map, groupBy, fold, and lazy sequences.

12

Error Handling & Files

try as an expression, require/check, runCatching, and file access.

Advanced
13

Sealed Classes, Value Classes & Exhaustive when

Modeling closed hierarchies and type-safe wrappers with no overhead.

14

Coroutines & Flow

Concurrency with suspend, launch, async, dispatchers, cancellation, and Flow.

15

Generics, Delegation & DSLs

Variance, reified, delegated properties, class delegation, and builder DSLs.

16

Gradle, Tests, Java Interop & Multiplatform

Setting up a project, testing, and mixing Kotlin with Java and other platforms.