title: Variable might not have been initialized, but it's set in constructor
body: <p>so I've tried to search for answer, but for this error message I'm founding irelevant answers to my problem.</p>
  
  <p>Here it is.
  Why this code:</p>
  
  <p>Case 1)</p>
  
  <pre><code>public class A {
      private final String A;
      private final String B;
      private final String C = A + B;
  
      public A(String A, String B) {
          this.A = A;
          this.B = B;
      }
  }
  </code></pre>
  
  <p>for line <code>private final String C = A + B;</code> it says these errors:</p>
  
  <pre><code>java: variable A might not have been initialized
  java: variable B might not have been initialized
  </code></pre>
  
  <p>But this works like a charm:</p>
  
  <p>Case2)</p>
  
  <pre><code>public class K {
      private final String K;
      private final String L;
      private final String M = kPlusL();
  
      public K(final String K, final String L) {
          this.K = K;
          this.L = L;
      }
  
      private String kPlusL() {
          return K + L;
      }
  }
  </code></pre>
  
  <p>Or also this works like a charm:</p>
  
  <p>Case 3)</p>
  
  <pre><code>public class O {
      protected final String O;
      protected final String P;
  
      public O(final String O, final String P) {
          this.O = O;
          this.P = P;
      }
  }
  
  public class Q extends O {
      private final String Q = O + P;
  
      Q (final String O, final String P) {
          super(O, P);
      }
  }
  </code></pre>
  
  <p>Can somebody explain me why please? I'm using IntelliJ IDEA and Java 1.8.0_151.</p>
  
  <p>All three cases are doing exact same thing (puts two Strings together), but one is doing it directly and second and third "indirectly".</p>