package com.itheima_27;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Set;
public class HashMapDemo {
public static void main(String[] args) {
HashMap<String,ArrayList<String>> hm = new HashMap<String,ArrayList<String>>();
ArrayList<String> al1 = new ArrayList<String>();
al1.add("诸葛亮");
al1.add("赵云");
hm.put("三国演义",al1);
ArrayList<String> al2 = new ArrayList<String>();
al2.add("孙悟空");
al2.add("唐僧");
hm.put("西游记",al2);
ArrayList<String> al3 = new ArrayList<String>();
al3.add("武松");
al3.add("鲁智深");
hm.put("水浒传",al3);
Set<String> keySet = hm.keySet();
for (String key:keySet){
System.out.println(key + ":");
ArrayList<String> value = hm.get(key);
for(String s:value){
System.out.println("\t" + s);
}
}
}
}