Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

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());
    }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #map #string #list #string #java
ADD COMMENT
Topic
Name
4+8 =