Given is the following construct
import scala.collection.mutable.HashMap
import scala.collection.mutable.LinkedList
private var log = new HashMap[String, LinkedList[String]]
How do I append to the linked list?
If I use log.get("some key").get :+ some_string
or log.get("some key").get append LinkedList(some_string)
the list is not appended but a new list containing the value is returned. Does HashMap only return a copy of the associated value instead of a reference to the value?
Off topic: Can someone with a high reputation add scala as a title-enabled tag? It should as it is a fairly known programming language.