import java.io.*;import java.util.*;
public class GetProperties {
  public static void main(String[] args) {
    String[] keys = {
      "username", "address",
      "city", "st", "zip"
    };
    String[] values = new String[5];
    Properties p = new Properties();
    FileInputStream in = null;
    try {
      in = new FileInputStream("myproperties.ini");
      p.load(in);
      System.out.println("Properties has " + p.size() + " entries");
      for (int i = 0; i < p.size(); i++) {
        System.out.println(keys[i] + " is " + p.getProperty(keys[i]));
      }
      System.out.println("age is " + p.getProperty("age"));
      System.out.println(
          "status is " + p.getProperty("status", "unknown"));
      in.close();
    } 
    catch (Exception e) {
      e.getMessage();
    }
  }
}