putAll
Updates this map with key/value pairs from the specified map from.
Since Kotlin
1.3Samples
import kotlin.test.*
import java.util.*
fun main() {
//sampleStart
val map = mutableMapOf(1 to "one", 2 to "two")
map.putAll(mapOf(3 to "three", 4 to "four", 1 to "_ONE_"))
println(map) // {1=_ONE_, 2=two, 3=three, 4=four}
//sampleEnd
}
Updates this map with key/value pairs from the specified map from.
Since Kotlin
1.1Samples
import kotlin.test.*
import java.util.*
fun main() {
//sampleStart
val map = mutableMapOf(1 to "one", 2 to "two")
map.putAll(mapOf(3 to "three", 4 to "four", 1 to "_ONE_"))
println(map) // {1=_ONE_, 2=two, 3=three, 4=four}
//sampleEnd
}
Updates this map with key/value pairs from the specified map from.
Since Kotlin
1.3Samples
import kotlin.test.*
import java.util.*
fun main() {
//sampleStart
val map = mutableMapOf(1 to "one", 2 to "two")
map.putAll(mapOf(3 to "three", 4 to "four", 1 to "_ONE_"))
println(map) // {1=_ONE_, 2=two, 3=three, 4=four}
//sampleEnd
}
Updates this map with key/value pairs from the specified map from.
Since Kotlin
1.8Samples
import kotlin.test.*
import java.util.*
fun main() {
//sampleStart
val map = mutableMapOf(1 to "one", 2 to "two")
map.putAll(mapOf(3 to "three", 4 to "four", 1 to "_ONE_"))
println(map) // {1=_ONE_, 2=two, 3=three, 4=four}
//sampleEnd
}
Updates this map with key/value pairs from the specified map from.
Since Kotlin
1.8Samples
import kotlin.test.*
import java.util.*
fun main() {
//sampleStart
val map = mutableMapOf(1 to "one", 2 to "two")
map.putAll(mapOf(3 to "three", 4 to "four", 1 to "_ONE_"))
println(map) // {1=_ONE_, 2=two, 3=three, 4=four}
//sampleEnd
}