import java.io.*;
import java.util.*;
public class SetProperties {
  public static void main(String[] args) {
    String[] keys = { "username", "address", 
                      "city", "st", "zip" };
    String[] values = { "John Doe", "111 Main St",
                        "Malvern", "PA", "19355" };
    Properties p = new Properties();
    FileOutputStream out = null;
    try {
      out = new FileOutputStream("myproperties.ini");
      for (int i = 0; i < keys.length; i++) {
        p.setProperty(keys[i], values[i]);
      }
      p.store(out, "User data");
    } 
    catch (Exception e) {
      e.getMessage();
    }
  }
}