创建配置文件&&获取配置参数

在src下新建.properties文件,添加参数及值。

获取配置文件内容:

Properties prop=new Properties(); 
	        prop.load(this.getClass().getClassLoader().
	        		getSystemResourceAsStream("xxx.properties"));
	        String xx=prop.getProperty("xx"); 


你可能感兴趣的:(创建配置文件&&获取配置参数)