java类中读取xxx.properties文件的内容
key=value
?
2.java中获取key值
Properties prop = new Properties();//如果properties文件和某个java文件在同一目录下,可以如下读取配置文件:InputStream inStream =Test.class.getClassLoader().getResourceAsStream("com/sange/factory/dongtai/xxx.properties")prop.load(inStream);//properties文件String keyValue = prop.getProperty("key");
?