java读取propertics属性文件方法:

 

属性文件直接放到src下(或者创建一个包文件夹,[一定要是包文件夹,不是普通文件夹])

 

import java.util.Properties;
Properties p=new Properties();
p.load(【现在的类】.class.getResourceAsStream("/【属性名】.properties"));//斜杠必须存在

 

详情http://wenku.baidu.com/view/d89a1d1655270722192ef7a4.html