public static void main(String args[]){ArrayList<Integer>list=new ArrayList<>();
list.add(1);
list.add(2);
list.add(3);
list.add(4);
for(Iterator<Integer> it=list.iterator();it.hasNext();){int tmp=it.next();
System.out.println(tmp);
}
HashMap<String,String>map=new HashMap<>();
map.put("语文","90");
map.put("数学","80");
map.put("英语","100");
Set<String>keys=map.keySet();
for(Iterator<String>it=keys.iterator();it.hasNext();){String tmp=it.next();
System.out.println("key is"+tmp);
System.out.println("value is"+map.get(tmp));
}
Set<Map.Entry<String,String>> enter=map.entrySet();
for(Iterator it=enter.iterator();it.hasNext();){System.out.println(it.next());
}
}