Kotlin - Null Safety
Identify the error in this Kotlin code snippet:
val text: String? = null
text.let { println(it.length) }val text: String? = null
text.let { println(it.length) }text.let without ?., so it runs even if text is null.it.length is called on null, causing a NullPointerException.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions