Kotlin basics
Learn values, functions, nullable types, and collections.
Prefer val for values you do not reassign
val prevents reassignment of the variable. It does not automatically make an object’s internals immutable.
val title = "My first app"
var completed = 0
completed += 1Make missing values explicit
A question mark permits null. Safe calls skip an operation when its receiver is null; the Elvis operator supplies a fallback.
fun greeting(name: String?): String {
return "Hello, ${name?.trim() ?: "developer"}!"
}Collections transform data
Use map to transform elements and filter to keep only the elements matching a condition. Read the result as a new value rather than changing the original list.
Try it yourself
Write a function that returns only nonempty, trimmed names from a list.

