title: Static final member variables vs. get methods
body: <p>I have a class with all the configuration from a property file. </p>
  
  <p>My first solution is this: </p>
  
  <pre><code>public class Config {
  
      public static final int disc;
  
      static {
  
          // Read property file and set properties
  
          disc = 5;
      }
  }
  </code></pre>
  
  <p>Reading the information in this way:</p>
  
  <pre><code>System.out.println(Config.disc);
  </code></pre>
  
  <p>The second solution is:</p>
  
  <pre><code>public class Config {
  
      private int disc;
  
      public void Config() {
  
          // Read property file and set properties
  
          disc = 5;
      }
  
      public int getDisc() {
          return this.disc;
      }
  }
  </code></pre>
  
  <p>Reading in that way:</p>
  
  <pre><code>System.out.println(new Config().getDisc());
  </code></pre>
  
  <p>What's the best way and why? What the advantages and disadvantages?</p>