title: How to store default values for a config file
body: <p>I am currently working on a server program that I want to add a config file to so the user can change certain items such as port, password, etc. I'm stumped on how I should store the default values for when the file is first generated or I need to re-generate it. First I stored them in private static final variables:</p>
  
  <pre><code>private static final int PORT = 12345;
  </code></pre>
  
  <p>I then changed to an Enum:</p>
  
  <pre><code> public Enum ConfigDefaults {
       PORT("port", "12345");
  
       private final String name;
       private final string value;
  
       public ConfigDefaults(String name, String value)
       {
           this.name = name;
           this.value = value;
       }
  
       public String getName()
       {
           return name;
       }
  
       public String getValue()
       {
           return value;
       }
   }
  </code></pre>
  
  <p>I am currently using the Enum however it doesn't seem like the best way to me. What would you recommend as a way to store the defaults for the file?</p>