java bit shifting
<p>I have the following line in my code :-</p>

<pre><code>if (( checker &amp; (1 &lt;&lt; val)) ) return false;
</code></pre>

<p>where checker is of type <code>int</code> and val is of type <code>int</code>. When I try to compile the same I get the following :-</p>

<pre><code>q11.java:38: incompatible types
found   : int
required: boolean
        if (( checker &amp; (1 &lt;&lt; val)) ) return false;
                      ^
1 error
</code></pre>

<p>However if I modify the code to have :-</p>

<pre><code>if (( checker &amp; (1 &lt;&lt; val)) &gt; 0 ) return false;
</code></pre>

<p>then I'm able to compile the source. I'm however unable to understand why the code did not work initially. Some pointers on why this happens?</p>
