遍歷Map集合

Map<String, String> textMap = new HashMap<String, String>();

textMap.put("keyA", "valueA");
textMap.put("keyB", "valueB");

Iterator iter = textMap.entrySet().iterator();

while (iter.hasNext())
{
Map.Entry entry = (Map.Entry) iter.next();
String inputName = (String) entry.getKey();
String inputValue = (String) entry.getValue();
if (inputValue == null)
{
continue;
}
}

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章