import java.util.HashMap; HashMap<String,String> h = new HashMap<String,String>(); h.put("key", "val"); // Ugly function call syntaxIn Scala:
import collection.mutable var h = mutable.HashMap[String,String]() h("key") = "val" // The nice equals syntax