System

 * System:
 * 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);
		}
                */
	}


}


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值