Paso 4: Escribir datos en la clase de propiedades dinámicamente
package com.blogspot.geekonjava;
import java.util.Properties; public class PropertiesWriteDemo { public static void main(String[] args) throws Exception { Properties properties = new Properties(); properties.setProperty("username", "online tutorial spoint"); properties.setProperty("password", "123456"); properties.store(new FileWriter("dbprops.properties"), "Db-Configurations"); } }