Null Safety

Learn about null safety in Kotlin.

Overview

In Kotlin, the nullability of a variable is an integral part of its type. Fortunately, it is quickly determined with a simple ?.

The infamous NullPointerException is probably the most common error message that Java programs produce at runtime. It is no coincidence that Tony Hoare, the inventor of the zero references, describes it as his trillion-dollar mistake.

Get hands-on with 1200+ tech skills courses.