title: How do you compare enum to int?
body: <p>I am trying to change the color by using an enum, I am comparing an enum to an int but it keeps throwing an error</p>
  <pre><code>public class Game {
  
  public enum State{
      RED, YELLOW, BLANK;
  }
  
  public State getState(int x, int y) {
      y=1;
      for (x=5;x&gt;0;x--) {
    if (x== BLANK &amp;&amp; y== BLANK) {
          return State.RED;
      }
      //return State.BLANK;
  }
      return State.BLANK;
  }
  </code></pre>
  <p>How do I compare an int to an enum? so that I can change the color in the first column y which is set to 1</p>