#collections #maps #scala
Concatenating Maps
You can use either ++ operator or Map.++() method to concatenate two or more Maps,
If you want to change selection, open document below and click on "Move attachment"
Scala Mapsit produces the following result:
C:/>scalac Test.scala
C:/>scala Test
Keys in colors : Set(red, azure, peru)
Values in colors : MapLike(#FF0000, #F0FFFF, #CD853F)
Check if colors is empty : false
Check if nums is empty : true
C:/>
<span>Concatenating Maps
You can use either ++ operator or Map.++() method to concatenate two or more Maps, but while adding Maps it will remove duplicate keys. Following is the example to concatenate two Maps:
object Test {
def main(args: Array[String]) {
val colors1 = Map("red& Summary
status | not read | | reprioritisations | |
---|
last reprioritisation on | | | suggested re-reading day | |
---|
started reading on | | | finished reading on | |
---|
Details