Kotlin (programming language): Difference between revisions

Content deleted Content added
Line 50:
Kotlin makes a difference between nullable and non-null datatypes. All nullable objects must be declared with a "?" postfix after the type name. Operations on nullable objects need special care from developers: null-check must be performed before using the value. Kotlin provides null-safe operators to help developers:
* ?. (safe navigation operator) can be used to safely access a method or property of a possibly null object. If the object is null, the method will not be called and the expression evaluates to null.
* ?: also known as the [[Elvis operator]]:
 
<source lang=Scala>