KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
class DefaultListMap[A, B <: List[B]] extends HashMap[A, B] { override def default(key: A) = List[B]() } I wan't to create map A -> List[B] . In my case it is Long -> List[String] but when I get key from map that doesn't have value I would like to create empty List instead of Exception being thrown. I tried different combinations but I don't know how to make code above pass the compiler. Thanks in advance.
Tags (comma-separated)
Save Edits
Cancel