//读操作 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 }