Kotlin - Null Safety
Identify the mistake in this Kotlin code:
val text: String? = null val length = text ?: 0.length
val text: String? = null val length = text ?: 0.length
0.length attempts to access length on an Int, which is invalid.?:.0.length is invalid because Int has no length property -> Option A15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions