Reason for The local variable may not have been initialized?
<p>This is what my method looks like</p>

<pre><code>public int abc()
{
  int x;
  if(x &gt; 100)
  {
    //Say ok
    return x;//Causes compiler error
  }

  //if something more, x = some number 

  return x;//Causes compiler error


}
</code></pre>

<p>I saw an answer at SO - <a href="http://stackoverflow.com/questions/12661417/java-local-variable-may-not-have-been-initialized-not-intelligent-enough">Java: &quot;Local variable may not have been initialized&quot; not intelligent enough?</a></p>

<p>But, I am still not sure why this error happens. Its a compiler error and not a warning. So, the problem must be something more serious than "taking a safe route".</p>
