The following code shows how to read and write properties file. With getProperty(key) method we can get the property value by passing property key and like that way with setProperty(key,value) we can set given value to the specified property.
// Read properties file.
// Read properties file.
- try {
- e.printStackTrace();
- }
- try {
- prproperties.setProperty("Key1", "ValueXxx");
- e.printStackTrace();
- }
- Key1=Value1
- Key2=Value2
- Key3=Value3
- Key1=ValueXxx
- Key2=Value2
- Key3=Value3
No comments:
Post a Comment