//保存属性到test2.properties文件
FileOutputStream out = new FileOutputStream("test2.properties", true);//true表示追加打开
//设置value(属性值)
prop.setProperty("phone", "10086");
//如果"The New properties file"不为空,保存后的属性文件第一行会是#The New properties file表示注释信息;如果为空则没有注释信息。prop.store(out, "The New properties file");
//关闭流
out.close();
-----读取-----load(InputStream inStream)这个方法可以从.properties属性文件对应的文件输入流中,加载属性列表到Properties类对象。Properties prop = new Properties();//读取属性文件test.properties(BufferedInputStream 输入流)InputStream in =