写属性
import java.io.FileOutputStream;/** 时 代 J a v a - N o w J a v a . c o m 提供 **/ import java.io.IOException; import java.io.OutputStream; import java.util.Properties; public class WriteProperties { public final static void main(String[] args) { Properties prop = new Properties(); OutputStream output = null; try { output = new FileOutputStream("config.properties"); /** 来自 N o w J a v a . c o m**/ // set the properties value prop.setProperty("database", "localhost"); prop.setProperty("dbuser", "user name"); prop.setProperty("dbpassword", "password"); // save properties to project root folder prop.store(output, null); } catch (IOException io) { io.printStackTrace(); } finally {