import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;
/*
* Copyright (c) 1999-2005 (주)ACTSoft. All rights reserved.
*/
* Copyright (c) 1999-2005 (주)ACTSoft. All rights reserved.
*/
/**
* @author Hong ByungChan
*
*/
public class MapSample {
* @author Hong ByungChan
*
*/
public class MapSample {
/**
*
*/
public MapSample() {
super();
}
*
*/
public MapSample() {
super();
}
/**
* @param args
*/
public static void main(String[] args) {
Map map = new HashMap();
map.put("key1", "value1");
map.put("key2", "value2");
map.put("key3", "value3");
map.put(null, null);
* @param args
*/
public static void main(String[] args) {
Map map = new HashMap();
map.put("key1", "value1");
map.put("key2", "value2");
map.put("key3", "value3");
map.put(null, null);
Set set = map.keySet();
Iterator iter = set.iterator();
while (iter.hasNext()) {
System.out.println(iter.next());
}
System.out.println(iter.next());
}
}
}
[출처] Map iterator 예제입니다.|작성자 들닢
'programming > java' 카테고리의 다른 글
String -> Reader, InputStream 변환 (0) | 2012.03.20 |
---|---|
digester (0) | 2012.03.20 |
톰캣6 windows 64bit 설치 (0) | 2012.03.20 |
textNode 변경하기 (0) | 2012.03.20 |
iframe 사이즈 늘리기(3) (0) | 2012.03.20 |