@Test
public void testList(){
String s="name";
ArrayList<String> list=new ArrayList<String>();
list.add("zhangsan");
Map<String, ArrayList<String>> map=new HashMap<String, ArrayList<String>>();
map.put(s, list);
Set<Map.Entry<String, ArrayList<String>>> set=map.entrySet();
//增强for
实现了Iterable接口集合都可以用
for(Map.Entry<String, ArrayList<String>> entry:set){
String s1=entry.getKey();
ArrayList<String> list1=entry.getValue();
System.out.println(s+"................"+list1.get(0));
}
}
其实有什么不懂的,都能百度到,度娘很强大