import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.util.Properties; public class PropertiesExample { public static void main(String[] args) { Properties props = new Properties(); props.setProperty("prop1", "value1"); props.setProperty("prop2", "value2"); props.setProperty("prop3", "value3"); try { props.store(new FileOutputStream("props.txt"), "These are some pedagogical properties"); } catch (IOException e) { System.out.println("Error saving properties."); e.printStackTrace(); } props = new Properties(); try { props.load(new FileInputStream("props.txt")); } catch (IOException e) { System.out.println("Error loading properties."); e.printStackTrace(); } } }