Map

Set<String> set = map.keySet();

for(String key:set){

System.out.println("key:"+key);

}

Collection<String> values = map.values();

for(String value:values){

System.out.println("value:"+value);

}

Set<Entry<String, String>> entrySet = map.entrySet();

for(Entry<String, String> key_value:entrySet){

String key = key_value.getKey();

String value = key_value.getValue();

System.out.println("key---"+key+",value:--"+value);

}


你可能感兴趣的:(Map)