Kotlin types are non‑null by default. To allow null you mark a type with ?. Safe calls (?.), the Elvis operator (?:), and scope functions like let help handle nullable values without NPEs. !! forces a non‑null assertion and can throw.
val name: String? = null
val length = name?.length ?: 0
println(length)