August 2018
Beginner
178 pages
4h 56m
English
Kotlin features like null safety are enforced during compile time and Kotlin tries to have (great) interoperability with Java. When Java code calls your Kotlin code it is already compiled and the Kotlin compiler cannot enforce its null checks. This is the reason why the Kotlin development team introduced a concept of a Platform Type. Simply put, a Platform Type is a type defined in Java (or any other JVM language).
In the case of nullability, Kotlin code can handle them as either nullable or non-nullable. If during runtime a null value is passed to a non-nullable variable, the Kotlin runtime will throw a null pointer exception.
Immutable Kotlin Collection types are treated similarly. Remember, Kotlin ...
Read now
Unlock full access