Kotlin - Operators and Expressions
Find the problem in this Kotlin code:
val a: String? = null val b: String? = null val c = a ?: b println(c.length)
Find the problem in this Kotlin code:
val a: String? = null val b: String? = null val c = a ?: b println(c.length)
a and b are null, so c becomes null.c.length causes a null pointer exception at runtime.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions