Nice article! Been considering learning Kotlin or Scala for Android recently, to try something different.
Also, I don't know if it's a typo, but in the example:
You can safely access a property that can be null with the keyword ‘?’:
var mutable = "mutable" println(mutable.legnth) -> 'print 7' var mutableCanBeNull: String? = null println(mutableNull?.length) -> 'does not crash! print null'
The last line shouldn't be mutableCanBeNull? instead of mutableNull? ?
Hi Leonardo, thanks for your message! yes it was, I've updated the post...!
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nice article! Been considering learning Kotlin or Scala for Android recently, to try something different.
Also, I don't know if it's a typo, but in the example:
The last line shouldn't be mutableCanBeNull? instead of mutableNull? ?
Hi Leonardo, thanks for your message! yes it was, I've updated the post...!