将列表(字符串)和地图(字符串,字符串)合并到地图的最佳方法[列表(字符串),地图(字符串,字符串)]

时间:2019-05-15 12:56:07

标签: java collections

//the list
 List<String> MyList = new ArrayList<String>;
 MyList.add("un");
 MyList.add("deux");
 MyList.add("trois");

// the map
Map<String, String> map = new HashMap<Integer, String>();  
hash_map.put("ab", "stack"); 
hash_map.put("bc", "over"); 
hash_map.put("de", "flow");

// the new map
Map<String, <String, String>> newMap:
("un", ("ab", "stack"))
("deux",("bc", "over"))
("trois",("de", "flow"))

对不起,我希望现在更加清楚。 对不起,我希望现在情况更加清楚。

0 个答案:

没有答案