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)
[주말]
[10/26]C#,ASP.NET마스터
[11/2]Spring3.X, MyBatis, Hibernate실무과정
[11/2]JAVA&WEB프레임워크실무과정
[평일야간]
[10/29]C#,ASP.NET마스터
[10/31]JAVA&WEB프레임워크실무과정
[11/1]Spring3.X, MyBatis, Hibernate실무과정
[주간]
[11/4]Spring3.X, MyBatis, Hibernate실무과정
[주말]
[10/26]C#,ASP.NET마스터
[11/2]Spring3.X, MyBatis, Hibernate실무과정
[11/2]JAVA&WEB프레임워크실무과정
[평일야간]
[10/29]C#,ASP.NET마스터
[10/31]JAVA&WEB프레임워크실무과정
[11/1]Spring3.X, MyBatis, Hibernate실무과정
[주간]
[11/4]Spring3.X, MyBatis, Hibernate실무과정
[기타
다른 강좌는 아래 해당 카테고리를 클릭해주세요]
댓글 없음:
댓글 쓰기