title: Power of 2 bit operator in Java?
body: <p>I have a int variable to save the option, that may include none, one or many sub-options like this:</p>
  
  <pre><code>public static final int OPERATOR_PLUS = 1;
  public static final int OPERATOR_SUBTRACT = 2;
  public static final int OPERATOR_MULTIPLY = 4;
  public static final int OPERATOR_DIVIDE = 8;
  </code></pre>
  
  <p>And I need a function that will return if that variant contains a sub-option. I tried:</p>
  
  <pre><code>return (Operator &amp; Operators);
  return (Operator &amp;&amp; Operators);
  </code></pre>
  
  <p>But Eclipse says both of them are grammar errors (both Operator and Operators are int). Please tell me how to use AND Bit operator in Java. In .NET, I use: <code>Operator And Operators</code>.</p>
  
  <p>Thanks.</p>