Kotlin is a statically typed programming language that runs on a Java virtual machine and can also be compiled into JavaScript source code or use the LLVM compiler framework.
Kotlin avoids null pointer exceptions by distinguishing between NULL and NULL types. All variables with a null value should be declared with ?? postfix after the type name. Operations with variables with a null value need special care from the developers: before using the value, you must perform a null check.
To call methods on a variable of type NULL, you must either use "?" an operator that only calls a method if the variable is not null (and makes it a nullable return type), or "!!" An operator that claims that a variable is not currently zero.
Please note that you can still get Kotlin exceptions with exceptions if you use "!!" operator on a null object or when interacting with Java.
source share