Kotlin - Collections Fundamentals
What is the output of this Kotlin code?
val map = mapOf("x" to 10, "y" to 20)
for ((k, v) in map) {
println("$k$v")
}val map = mapOf("x" to 10, "y" to 20)
for ((k, v) in map) {
println("$k$v")
}k and v.println("$k$v") prints key and value together without space, so outputs are "x10" and "y20" on separate lines.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions