title: Java value is always null?
body: <p>I have a value in Java that is always null but I don't understand why, because I am setting the value of the variable using the class constructor.</p>
  
  <p>I have code like such:</p>
  
  <pre><code>Driver driverClass = new Driver("&lt;file path redacted&gt;");
  </code></pre>
  
  <p>And then the below:</p>
  
  <pre><code>String cfgFilePath;
  
  public Driver(String cfgFile) {
      this.cfgFilePath = cfgFile;
  }
  
  private ArrayList&lt;String&gt; keys = getKeys(cfgFilePath);
  private String a1 = keys.get(0);
  private String b1 = keys.get(1);
  </code></pre>
  
  <p>For some reason, IntelliJ IDEA says that cfgFilePath is always null. I am initializing it with the Driver class constructor, so why is it null? When I run the program I get a null pointer exception.</p>