Using enum as a class in java
<p>I have a class with <strong>enum</strong> in it and class, which contains <strong>list</strong> of that objects</p>

<pre><code>public enum State {
    ACTIVE,NOT_ACTIVE;
}

public class SomeObject {
    State state;        
    public SomeObject(State state) {
        this.state = state;
    }
}    

public class SomeObjects{
    State state;
    ArrayList&lt;SomeObject&gt; objects = new ArrayList&lt;Main.SomeObject&gt;();       
    public SomeObjects(int count) {
        state = State.ACTIVE;
        for (int i = 0; i &lt; count; i++) {
            objects.add(new SomeObject(state));
        }
    }       
    public void changeState(State state) {
        this.state = state;
    }
}
</code></pre>

<p>And now if I use <code>changeState(State.NOT_ACTIVE)</code> it will change state in <strong>SomeObjects</strong> and in all Objects in <strong>list</strong> or only in SomeObjects?</p>

<p>If only in <strong>SomeObjects</strong>, what should I do to <strong>change state</strong> in all Objects in list with <code>changeState()</code>?</p>

<p>Is the creating of class, containing that enum, the <strong>only way</strong> in this case?</p>

<p><strong>UPDATE:</strong> thanks, but in my case i need to change state of all objects with </p>

<pre><code>this.state = state;
</code></pre>
