Concatenate Two Maps in Scala
The concatenation of Scala map is obtained by utilizing ++ operator.
def ++(xs: Map[(A, B)]): Map[A, B]
It returns a single map by concatenating two maps but it separates the identical keys.
Map(Nidhi -> 23, Rahul -> 18, Geeta -> 22)
As we can see in above example, we joined two maps by using ++ operator.
Map(geeks -> 5, for -> 3, cs -> 2)