Kotlin (programming language): Difference between revisions

Content deleted Content added
Spelling/grammar correction
K0zka (talk | contribs)
Line 48:
</source>
 
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 needs special care from developers: null-check must be performed before using the value. Kotlin provides null-safe operators to help developers:
* ?. 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 [[Elvis operator]]
 
<source lang=Scala>