Last active
August 1, 2016 11:56
-
-
Save fabiomsr/ae3476fb2e3fd9ccb188bc2a80886330 to your computer and use it in GitHub Desktop.
This file contains 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
// Java | |
if(text != null){ | |
int length = text.length(); | |
} |
This file contains 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
// Kotlin | |
// Text = String? | |
val length = text!!.length // NullPointerException if text == null |
This file contains 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
// Kotlin | |
// Text = String? | |
val length = text?.length |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment