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
本文详细介绍了如何使用Java操作Properties文件,包括加载文件、读取属性和存储修改后的属性。通过实例演示了如何实现这一过程。
7943

被折叠的 条评论
为什么被折叠?



