Why is this Map not populating when I'm evaluating this code in Eclipse?

StackOverflow https://stackoverflow.com/questions/21485245

  •  05-10-2022
  •  | 
  •  

سؤال

Below code should populate a Map but when I do a val test = userDataMap.get("test").get the value is null. Whis is this occuring ? This seems to be the correct way of populating a Map ?

var userDataMap = Map.empty[String, List[String]]
userDataMap += ("test" -> List("test"))

لا يوجد حل صحيح

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top