개발자 미니민의 개발스터디

[JAVA] 자바 - Enumeration 인터페이스와 Properties

by mini_min

[JAVA]
자바 - Enumeration 인터페이스와 Properties

✔️ Enumeration 인터페이스와 Properties

Enumeration 클래스는 사전적으로 '열거' 라는 뜻을 가지고, 어떤 객체 모임이 있을 때, 객체들을 어떤 순서에 의해서 하나씩 접근해서 사용하는 인터페이스다. 최근에는 Iterator 인터페이스 사용하기도 한다.

 

public static void main(String[] args) {
	Properties p = System.getProperties();
		
	Enumeration<?> e = p.propertyNames();
	while(e.hasMoreElements()) {
		String key = (String)e.nextElement();
		String value = p.getProperty(key);
		System.out.println(key + " ===> " + value);
	}
}

 

 

 

 

 

블로그의 정보

개발자 미니민의 개발로그

mini_min

활동하기