The not-null assertion removes all of the compiler restrictions from a nullable type, allowing it to be used in the same ways as a non-null type, even if it has been assigned a null value. This assertion is implemented using double exclamation marks after the variable name, for example:
val username: String? = null
val length = username!!.length
The above code will now compile, but will crash with the following exception at runtime since an attempt is being made to call a function on a non existent object:
Exception in thread "main" kotlin.KotlinNullPointerException
Clearly, this causes the very issue that nullable types are designed to avoid. Use of the not-null assertion is generally discouraged and should only be used in situations where you are certain that the value will not be null.