* System:
* out:标准输出,默认控制台
* in:标准输入,默认键盘
*
* 获取系统属性信息 Properties getProperties()
*
* 由于Properties 是HashTable的子类,也属于Map集合
* 所以可以通过Map集合的方法取出该集合中的元素
* out:标准输出,默认控制台
* in:标准输入,默认键盘
*
* 获取系统属性信息 Properties getProperties()
*
* 由于Properties 是HashTable的子类,也属于Map集合
* 所以可以通过Map集合的方法取出该集合中的元素
public class SystemDemo {
public static void main(String[] args) {
//在系统中自定义一些特有信息
System.setProperty("mhc", "19911006");
//获取指定属性信息
String str = System.getProperty("mhc");
System.out.println(str);
/*
Properties prop = System.getProperties();
for(Object obj : prop.entrySet())
{
String value = (String)prop.get(obj);
System.out.println(obj+"----"+value);
}
*/
}
}