I have an issue.
I have a properties file. I want to store some values in that file and will implement in the code whenever it is required. Is there any way to do t
This work for me.
Properties prop = new Properties();
try {
InputStream in = new FileInputStream("src/loop.properties");
prop.load(in);
} catch (IOException ex) {
System.out.println(ex);
}
//Setting the value to our properties file.
prop.setProperty("LOOP", "1");
//Getting the value from our properties file.
String value = prop.getProperty("LOOP").trim();
try {
prop.store(new FileOutputStream("src/loop.properties"), null);
} catch (IOException ex) {
System.out.println(ex);
}