据JDK5的新特性,用For循环Map,例如循环Map的Key
for(String dataKey : paraMap.keySet())   {    
    System.out.println(dataKey );               
}
注意的是,paraMap 是怎么样定义的,如果是简单的Map paraMap = new HashMap ();那前面的String就只能换成Object了.循环整个map的key和value
Map<Integer,String> map = new LinkedHashMap<Integer,String>(); 
map.put(1, "星期一"); 
map.put(2, "星期二"); 
map.put(3, "星期三"); 
map.put(4, "星期四"); 
map.put(5, "星期五"); 
map.put(6, "星期六"); 
map.put(7, "星期日"); 
for(Map.Entry<Integer, String> entry: map.entrySet()) { 
 System.out.print(entry.getKey() + ":" + entry.getValue() + "/t"); 
}
输出:1:星期一 2:星期二 3:星期三 4:星期四 5:星期五 6:星期六 7:星期日