Java 读写 Properties 文件

 
//读操作
Properties properties = new Properties(); 
try
{ 
    properties.load(new FileInputStream("filename.properties")); 
} 
catch (IOException e) 
{ 
    // implement catch logic
}

//写操作
Properties properties = new Properties();
try
{
    properties.store(
        new FileOutputStream("filename.properties"), null);
} 
catch (IOException e) 
{
    // implement catch logic
}

编程技巧