HashMap(key: String, value: ArrayList) returns an Object instead of ArrayList?

前端 未结 5 1827
别那么骄傲
别那么骄傲 2021-02-04 17:11

I\'m storing data in a HashMap with (key: String, value: ArrayList). The part I\'m having trouble with declares a new ArrayList \"current,\" searches the HashMap for the String

5条回答
  •  有刺的猬
    2021-02-04 17:53

    I suppose your dictMap is of type HashMap, which makes it default to HashMap. If you want it to be more specific, declare it as HashMap, or even better, as HashMap>

提交回复
热议问题