Last active
May 18, 2017 07:01
-
-
Save goindwalia/fba781d82bbf052627b1f1f0c1b2d4b6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* won’t compile */ | |
val name: String? = null | |
val len = name.length | |
/* correct way */ | |
val name: String? = null | |
val len = name?.length |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment