If we use map then no need to import immutable map
scala> val map=Map[String,Int]()
map: scala.collection.immutable.Map[String,Int] = Map()
But if we use HashMap, then without doing import, it gives error.
scala> val a=HashMap[Int,Int]()
<console>:7: error: not found: value HashMap
val a=HashMap[Int,Int]()
^
but doing import scala.collection.immutable.HashMap, it works.
I also see it with Set and Hashset..
I notice one thing that Map and Set are trait and HashSet,HashMap are classes.
So Why it is so ???
EDIT
Class Stack and Queue is also exist in scala.collection package. then why do we need to import these classes. ???