首页 > 编程语言 > 详细

Java之获取系统属性

时间:2015-08-21 13:08:48      阅读:174      评论:0      收藏:0      [点我收藏+]
 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 }

 

Java之获取系统属性

原文:http://www.cnblogs.com/liyiran/p/4747306.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!