title: How to declare empty list and then add string in scala?
body: <p>I have code like this:</p>
  
  <pre><code>val dm  = List[String]()
  val dk = List[Map[String,Object]]()
  
  .....
  
  dm.add("text")
  dk.add(Map("1" -&gt; "ok"))
  </code></pre>
  
  <p>but it throws runtime java.lang.UnsupportedOperationException.</p>
  
  <p>I need to declare empty list or empty maps and some where later in the code need to fill them.</p>