※ 값이 너무 길경우 ... 생략으로 표시된다.
public static void main(String[] args) {
// TODO Auto-generated method stub
Properties pros = System.getProperties();
pros.list(System.out);
}
※ 값의 생략없이 전체를 확인
public static void mainx(String[] args) {
// TODO Auto-generated method stub
Properties pros = System.getProperties();
Enumeration<?> enums = pros.propertyNames();
int idx = 0;
while (enums.hasMoreElements()) {
String key = (String) enums.nextElement();
String val = pros.getProperty(key);
System.out.printf("%02d) %s = %s\n", ++idx, key, val);
}
}
public static void main(String[] args) {
Properties pros = System.getProperties();
Enumeration<?> enums = pros.propertyNames();
List<String> list = (List<String>)Collections.list(enums);
Collections.sort(list);
int idx = 0;
for(String key: list) {
System.out.printf("%02d) %s = %s\n", ++idx, key, pros.getProperty(key));
}
}
public static void main(String[] args) {
Properties pros = System.getProperties();
SortedMap sortPros = new TreeMap(pros);
Set<?> keySet = sortPros.keySet();
Iterator<?> iterator = keySet.iterator();
int idx = 0;
while (iterator.hasNext()) {
String key = (String) iterator.next();
String val = pros.getProperty(key);
System.out.printf("%02d) %s = %s\n", ++idx, key, val);
}
}