title: Retrieve data from Properties file in Java
body: <p>I have a static array list in my code. Now I want that should be moved to the properties file so that if there is any change or modification in future I have simply change the values in properties file and it will be reflected everywhere where it is used.</p>
  
  <p>As of now static code is like this:</p>
  
  <pre><code>ArrayList dataList = new ArrayList();
  dataList.add("A");
  dataList.add("B");
  dataList.add("E");
  dataList.add("G");
  dataList.add("H");
  dataList.add("P");
  dataList.add("W");
  
  
  
  ArrayList TypeList = new ArrayList();
  TypeList.add(new Brand("A", "Test1"));
  TypeList.add(new Brand("B", "Test2"));
  TypeList.add(new Brand("E", "Test3"));
  TypeList.add(new Brand("G", "Test4"));
  </code></pre>
  
  <p>I have tried this but this is not working:</p>
  
  <pre><code>Properties prop = new Properties();
  prop.load(new FileInputStream("/displayCategerization.properties"));
  </code></pre>
  
  <p>I want both of them to be dynamic and the values should be picked from properties file. How can I do this?</p>