Safety feature
Another reason you will love Kotlin is its safety feature. The code written in Kotlin is far safer than that written in Java. Kotlin is designed in a way to shield it from the common programming flaws, which results in a more stable system with fewer crashes and failures.
For any programming language that allows the null reference will create a runtime exception, such as NullPointerException , during the execution of the application. Improper handling of such a scenario may result in an abrupt system collision. If you have prior experience of Java, you might have experienced such scenarios.
Kotlin was designed with this in mind and defines the reference types in two categories: those that are nullable and those that are not. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access