title: How to cast a value from one enum to another in Java?
body: <p>How can I cast a value from Enum1 to Enum 2 in Java?
  Here is an example of what I'm trying to do :</p>
  
  <pre><code>public enum Enum1 {
    ONE,
    TWO,
    THREE;
  }
  
  public enum Enum2 {
    FOUR,
    FIVE,
    SIX;
  }
  </code></pre>
  
  <p>So I want to do something like this:</p>
  
  <pre><code>Enum2 en2 = (Enum2)ONE;
  </code></pre>
  
  <p>Is it possible and how can I do that?</p>
  
  <p>Thanks in advance!</p>