Kotlin - Null Safety
Find the problem in this Kotlin code:
val list: List? = listOf("a", "b") println(list?.get(2)?.toUpperCase())
val list: List? = listOf("a", "b") println(list?.get(2)?.toUpperCase())
list?.get(2) is used, but get(2) accesses index 2 which is out of bounds.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions