Kotlin - Variables and Type System
Identify the error in this Kotlin code:
val list = listOf(1, 2, 3) list.add(4)
val list = listOf(1, 2, 3) list.add(4)
listOf creates an immutable list that does not support add.add(4) causes a compilation error.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions