October 2018
Intermediate to advanced
370 pages
9h 15m
English
Nullability is one of the reasons that most applications crash. Kotlin is very strict when it comes to safety. Every application user (especially mobile users) want a nice, simple, and smooth user experience. An application that crashes makes more than 90% of users frustrated, causing them to instantly uninstall the application.
See the following example of Java. Here, the variable name is assigned a null value, which is the correct syntax in Java:
String name = null; // OK in javaint length = name.length(); // application crashed
But when name.length will be executed, Java will throw NullPointerException. In Kotlin, it is very important to note that variables are non-nullable by default and we cannot assign null values to them. ...
Read now
Unlock full access