for (Iterator i = keys.iterator(); i.hasNext()
{
String key = (String) i.next();
String value = (String) map.get(key);
text+=key + " = " + value;
}
<span style="border-collapse: collapse; font-family: Arial,'Liberation Sans','DejaVu Sans',sans-serif; line-height: 18px; font-size: 14px; white-space: normal;"><pre class="lang-java prettyprint"><span>
</span></pre>
</span>
或者
or (Map.Entry<String,String> entry : map.entrySet()) {
String key = entry.getKey();
String value = entry.getValue();
// do stuff
} Iterator<Entry<String,String>> iterator = map.entrySet().iterator();