KtKotlin · Lesson 2 of 8
Null Safety
The billion-dollar mistake, fixed in the type system. In Kotlin, String and String? are different types — and the compiler refuses code that could throw a NullPointerException.
⚠ Warning
Every !! in your code is a place you've told the compiler to stop protecting you. Treat it as a code smell — there's almost always a ?. / ?: / let shape that expresses the intent safely.
Every !! in your code is a place you've told the compiler to stop protecting you. Treat it as a code smell — there's almost always a ?. / ?: / let shape that expresses the intent safely.