title: java - operator & not defined for types (boolean, int)
body: <p>i'm converting a c++ header to java and the following does not work.
  opstring is a string and alumacOP is a string array. opindex is an int.</p>
  
  <pre><code>opstring = alumacOP[opindex][(op &gt;&gt; 11) &amp; 3 == 3]; //code does not work.
  </code></pre>
  
  <p>this does not work for some reason. it's not the algorithm, but eclipse saying that '&amp;' is not defined for types boolean and int.</p>
  
  <p>so my question is: Why does logical AND reference only Boolean values in java? because this works:</p>
  
  <pre><code>boolean boola,boolb;
  if(boola &amp; boolb)
    return;
  </code></pre>
  
  <p>but not this (eclipse still throws an error:</p>
  
  <pre><code>int x = 9, y = 8;
  for(int i = 0; i &lt; 100; i++)
    if(x &amp; y = i)
      return;
  </code></pre>