private Map<String, Object> map ;
private Properties props;
private Set<Object> set;
......
for(Map.Entry<String, Object> entry:map.entrySet()) {
System.out.println("Key: " + entry.getKey() + "-" + entry.getValue());
}
System.out.println("Key: " + entry.getKey() + "-" + entry.getValue());
}
for(Map.Entry<Object, Object> entry : props.entrySet()) {
System.out.println("key : " + entry.getKey() + "-" + entry.getValue() );
}
System.out.println("key : " + entry.getKey() + "-" + entry.getValue() );
}
for(Object obj : set) {
System.out.println("value : " + obj);
}
System.out.println("value : " + obj);
}
[예제]
package day5;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.Vector;
import java.util.HashSet;
import java.util.Map;
import java.util.Properties;
import java.util.Set;
import java.util.Vector;
public class Test {
public static void main(String[] args) {
Map<String, Object> map = new HashMap();
Set<String> set = new HashSet();
Properties props = new Properties();
map.put("1", "1길동");
map.put("2", "2길동");
set.add("홍길동");
set.add("김길동");
props.put("3", "3길동");
props.put("4", "4길동");
public static void main(String[] args) {
Map<String, Object> map = new HashMap();
Set<String> set = new HashSet();
Properties props = new Properties();
map.put("1", "1길동");
map.put("2", "2길동");
set.add("홍길동");
set.add("김길동");
props.put("3", "3길동");
props.put("4", "4길동");
for (Map.Entry<String, Object> entry : map.entrySet())
{
System.out.println("Key: " + entry.getKey() + "-"
+ entry.getValue());
}
System.out.println("Key: " + entry.getKey() + "-"
+ entry.getValue());
}
for (String str : set) {
System.out.println("value : " + str);
}
for (Map.Entry<Object, Object> entry : props.entrySet()) {
System.out.println("Key: " + entry.getKey() + "-"
+ entry.getValue());
}
}
}
System.out.println("value : " + str);
}
for (Map.Entry<Object, Object> entry : props.entrySet()) {
System.out.println("Key: " + entry.getKey() + "-"
+ entry.getValue());
}
}
}
[개강임박강좌, 오프라인교육장에 오시면 보다 자세히 배울 수 있습니다.]
오라클자바커뮤니티에서 운영하는 개발자 전문교육 ,개인80%환급(www.onjprogramming.co.kr)
[주간]
[11/13]SQL초보에서실전전문가까지
[11/13]안드로이드개발자과정
[11/18]Spring3.X, MyBatis, Hibernate실무과정
[11/18]iPhone 하이브리드 앱 개발 실무과정
[평일야간]
[11/08]C#,ASP.NET마스터
[11/08]Spring3.X, MyBatis, Hibernate실무과정
[11/12]iPhone 하이브리드 앱 개발 실무과정
[11/14]JAVA&WEB프레임워크실무과정
[주말]
[11/09]JAVA&WEB프레임워크실무과정
[11/09]Spring3.X, MyBatis, Hibernate실무과정
[11/09]웹퍼블리싱 마스터
[11/16]C#,ASP.NET마스터
[11/16]PL/SQL,오라클힌트,SQL튜닝,사례연구
[11/16]ASP.NET4.0 MVC 프로그래밍
댓글 없음:
댓글 쓰기