Java Enum cannot find symbol error
<p>I recently ran into this error that took me quite a while to figure out. </p>

<p>I thought I should post it on here in case someone else might run into it too, though the probability of that might be extremely low (see below).</p>

<p>I recently started using enum in Java, as follows</p>

<pre><code>public enum State {
    ON, OFF
}
</code></pre>

<p>And then, in my object, which extends from <code>Thread</code>, there is a variable called state:</p>

<pre><code>public class Example extends Thread {
    private State state;
    public Example() { state = State.OFF; } // initialize object at OFF state
</code></pre>

<p>This will however gives an error at compile time as such:</p>

<pre><code>./Example.java:3: error: cannot find symbol
    state = State.OFF;
                 ^
  symbol:   variable OFF
  location: class State
1 error
</code></pre>
