title: Compile time error "final variable is not initialized"
body: <p>I have an issue, while trying few code snippets i came across a code</p>
  
  <pre><code>class O
  {
      final int i;
      O()
      {
          i=10;
      }
      O(int j)// error here as THE BLANK FINAL FIELD i IS NOT INITIALIZED
      {
          j=20;
          System.out.println(j);
      }
  }
  class Manager3
  {
      public static void main(final String[] args) 
      {
          O n1=new O();
          //O n2=new O(10);
          //n1.i=20;
          //System.out.println(j1.i);
      }
  }
  </code></pre>
  
  <p>but if i comment the constructor with parameter i do not get any errors.</p>
  
  <p>My question is why am i getting this compile time error when i put both the constructor in code and why i dont get any error when i remove parameterized constructor.</p>
  
  <p>I know that we have to initialize my final variable, but i am initializing it in constructor thus if i write this code :-</p>
  
  <pre><code>class O
  {
      final int i;
      O()
      {
          i=10;
      }
  
  }
  class Manager3
  {
      public static void main(final String[] args) 
      {
          O n1=new O();
  
      }
  }
  </code></pre>
  
  <p>every this is working fine and code is compiling.</p>
  
  <p>My question is what is the issue if i introduce another constructor. Even the error is at the line where i write parameterized cons.</p>
  
  <p>I have understanding of JAVA but i am confused in this code.</p>