title: Using java Map in scala
body: <p>I am thoroughly confused by this behavior in the Scala REPL:</p>
  
  <pre><code>scala&gt; import java.util.Map
  import java.util.Map
  
  scala&gt; import java.util.HashMap
  import java.util.HashMap
  
  scala&gt; val jMap:java.util.Map[String,Int]=new HashMap[String,Int]("first"-&gt;1,"second" -&gt; 2)
  
  &lt;console&gt;:12: error: type mismatch;
  found   : (String, Int)
  required: Float
     val jMap =new HashMap[String,Int]("first"-&gt;1,"second" -&gt; 2)
                                                                       ^
  &lt;console&gt;:12: error: type mismatch;
  found   : (String, Int)
  required: Float
     val jMap=new HashMap[String,Int]("first"-&gt;1,"second" -&gt; 2)
                                                                                    ^
  </code></pre>
  
  <p>Can someone help explain what's going on here ?</p>