Created
March 19, 2017 15:46
-
-
Save Majirefy/d7a255013b493fecf48e5a858fbbee39 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
var str: String = "example" | |
str = null // compilation error, str can not hold null | |
var b: String? = "example" | |
b = null // OK, b can hold null | |
println(a?.substring(0,4)) // prints "exam" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment