/**
* @author Bo年再无木小白
* @date 2013-11-07
*/
import java.util.HashMap;
import java.util.Iterator;
import java.util.Set;
public class HashSetTest {
public static void main(String[] args) {
HashMap map = new HashMap();
map.put("a", "aa");
map.put("b", "bb");
map.put("c", "cc");
map.put("d", "dd");
map.put("e", "ee");
Set set = map.keySet();
for(Iterator itr=set.iterator();itr.hasNext();){
String value =(String) itr.next();
String key = (String)map.get(value);
System.out.println(value+"="+key);
}
}
}
遍历 HashMap简单的方式
最新推荐文章于 2023-10-19 17:16:56 发布