fork(7) download
  1. import scala.collection.{Map, mutable}
  2.  
  3. object Main extends App {
  4. val t: mutable.Map[String, Long] = mutable.Map("key"→ 20L)
  5. t.getOrElseUpdate("key", 30L)
  6. println(t)
  7. }
Success #stdin #stdout 0.4s 4382720KB
stdin
Standard input is empty
stdout
Map(key -> 20)