Properties prop = new Properties();
try {
prop.load(new FileInputStream("filename.properties"));
} catch (IOException e) {
}
// Write properties file.
try {
prop.store(new FileOutputStream("filename.properties"), null);
} catch (IOException e) {
}
转载自: http://www.java-tips.org/java-se-tips/java.util/how-to-read-and-write-a-properties-file.html