How to get values from a Map with different value types? (Java)

前端 未结 3 1579
故里飘歌
故里飘歌 2021-01-28 20:41

I have a utility function that returns Map, but that Map always has this structure:

{ \"a\": , \"b\"         


        
3条回答
  •  滥情空心
    2021-01-28 21:00

    Basically whenever I reach this point of storing with a HashMap or any map for that sort. I tend to go ahead and cast it. Take for example I have a class named Module that I am getting the value of and the key is the module name. I would go (Module) map.get(modName);

提交回复
热议问题