Java之获取系统属性

 1 import java.util.Enumeration;
 2 import java.util.Properties;
 3 
 4 public class Example609 {
 5     public static void main(String[] args) {
 6         // TODO Auto-generated method stub
 7         Properties properties = System.getProperties();
 8         Enumeration propertiesNames = properties.propertyNames();
 9         while (propertiesNames.hasMoreElements()) {
10             String key = (String) propertiesNames.nextElement();
11             String value = System.getProperty(key);
12             System.out.println(key+"->"+value);
13         }
14 
15     }
16 
17 }

 

posted @ 2015-08-21 11:16  熠然  阅读(233)  评论(0编辑  收藏  举报