title: The best way to compare enums
body: <p>I have an enum, for example <code>enum Color { Red, Brown }</code>.  I also have some variables of that type:</p>
  
  <pre><code>Color c1 = Brown, c2 = Red
  </code></pre>
  
  <p>What is best way to compare to a constant value: </p>
  
  <pre><code>if (c1 == Color.Brown) { 
      //is brown
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>if (c1.equals(Color.Brown)) {
      //is brown
  }
  </code></pre>