What will be the result of following code execution?
val myMap = Map("MI" -> "Michigan", "OH" -> "Ohio", "WI" -> "Wisconsin", "MI" -> "Meechigan")

myMap("MI")
Explanation
Maps insertion with duplicate key updates previous entry with subsequent value.

Source: Scala Exercises: Maps

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback