Map的几种循环方式

for(String dataKey : paraMap.keySet()) {   
    System.out.println(dataKey );              
}

for(Map.Entry<String, Object> entry : paraMap.entrySet()) {   
    System.out.println(entry.getKey()+": "+entry.getValue());   
}

Iterator it = paraMap.entrySet().iterator();   
while (it.hasNext()) {
        Map.Entry pairs = (Map.Entry)it.next();   
        System.out.println(pairs.getKey() + " = " + pairs.getValue());   
}

你可能感兴趣的:(java)