一、Properties格式的写入
Properties类继承Hashtable类,所以Properties文件格式是以键值对形式存储。Properties格式的写入:先创建Properties类的对象,可通过对象的put()方法添加元素,再通过store()方法或save()方法将输出流中的内容写入指定位置的Properties文件中。
代码如下(示例):
try (BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream("E:\\JavaTest\\aaa\\data.properties"))) {
Properties pops = new Properti