iterator 遍历hashmap的最快方法

public static void evalMap(HashMap<Integer, String> hashmap){
		Iterator iter = hashmap.entrySet().iterator();
		while(iter.hasNext()){
			Map.Entry<Integer, String> entry= (Map.Entry<Integer, String>)iter.next();
			System.out.println("Key: "+ entry.getKey() + " , Val: "+ entry.getValue());
		}
		 
	}

 

你可能感兴趣的:(iterator)