HashMap is used to store element. It use hash code to store elements and return a map.
In this example, we have created a HashMap.
Map() Map(A -> Apple, B -> Ball, C -> Cat)
Scala HashMap Example: Adding and Accessing Elements
In the following example, we have created a HashMap. this program add elements and access elements as well.
A -> Apple B -> Ball C -> Cat Ball A -> Apple B -> Ball C -> Cat D -> Doll