What will be the Map size in the following code?
val myMap = Map("MI" -> "Michigan", "OH" -> "Ohio", "WI" -> "Wisconsin", "MI" -> "Michigan")

myMap.size
Explanation
Maps do not contain multiple identical pairs.

Source: Scala Exercises: Maps

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes