标签:lang stat dwr read files store string stp exception
package com.company;
import java.io.*;
import java.util.Properties;
public class Main {
public static void main(String[] args) throws IOException {
myWrite();
myReader();
}
private static void myReader() throws IOException {
final Properties properties = new Properties();
final BufferedReader bufferedReader = new BufferedReader(new FileReader("E:\\files\\codesrc\\IDEA\\FirstPrj\\src\\com\\io\\滕王阁序.txt"));
properties.load(bufferedReader);
System.out.println(properties);
bufferedReader.close();
}
private static void myWrite() throws IOException{
final Properties properties = new Properties();
properties.setProperty("张san","23");
properties.setProperty("陈2","23");
properties.setProperty("韩6","23");
final BufferedWriter bufferedWriter = new BufferedWriter(new FileWriter("E:\\files\\codesrc\\IDEA\\FirstPrj\\src\\com\\io\\滕王阁序.txt"));
properties.store(bufferedWriter,"First Commit");
bufferedWriter.close();
}
}
标签:lang stat dwr read files store string stp exception
原文地址:https://www.cnblogs.com/flowliver/p/14320929.html