Kotlin - Collections Fundamentals
Which of the following is the correct syntax to create a mutable map with keys "a" and "b" and values 1 and 2 respectively?
mutableMapOf with pairs using to keyword.mutableMapOf and to correctly. val map = mapOf("a" -> 1, "b" -> 2) uses wrong arrow ->. val map = mutableMapOf("a" = 1, "b" = 2) uses = which is invalid here. val map = mapOf("a" to 1, "b" to 2) uses mapOf which creates an immutable map.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions