【Java】零碎點 3

  1. HashMap.entrySet()
for (Map.Entry<Integer, Integer> entry : hashmap.entrySet(){
	System.out.print("(" + entry.getKey() + "," + entry.getValue() + ") ");
}
System.out.println("are in the hash map.");

// (0,9) (99,2) are in the hash map.
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章