title: loading the properties file
body: <p>I wanted to read some properties file. 
  For that I created a small program which reads, writes and also updates this properties file.</p>
  
  <p>Now some people are saying the properties file should be read only once, that means when the class is loaded it should read once, not multiple times for each key. </p>
  
  <p>So I have to read the properties file inside a static block. </p>
  
  <p>Now my doubt if I make any new entry to the properties file, will it be loaded the new entry ? </p>
  
  <p>Please suggest me which is the correct way to design the loading of properties file.</p>
  
  <pre><code>public class Parser {
  
      private String path;
  
      private static Properties prop = new Properties();
  
      public Parser(String path) throws IOException{
  
          this.path = path;
  
          load();
  
      }
  
      public  Model readPropertiesFile(){
  
          Model model = new Model();
  
          model.setName(prop.getProperty("name"));
  
          return model ;
  
  
  
      }
  
      public void createOrUpdatePropertiesFile(Model model){
  
          prop.setProperty("name", model.getName());
      }
  
      public void setPath(String path){
           this.path = path;
      }
  
      public String getPath(){
          return path ;
      }
  
  
  
      public  void load() throws IOException{
  
          File file = new File(path);
          if(!file.exists()){
              file.createNewFile();
                System.out.println("File created..");
          }
                          prop.load(new FileInputStream(file));
  
  
  
  
  
      }
  </code></pre>