Answers for "java reading a map with list of strings"

1

map string list string in java

Map<String, List<String>> myMaps = new HashMap<String, List<String>>();
    for (DataObject item : myList) {
        if (!myMaps.containsKey(item.getKey())) {
            myMaps.put(item.getKey(), new ArrayList<String>());
        }
        myMaps.get(item.getKey()).add(item.getValue());
    }
Posted by: Guest on May-05-2021

Code answers related to "java reading a map with list of strings"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language