What if you get a question like this.
<pre>
public class BitShiftTest{
public static void main(String args[])
{
int n = 7;
n <<= 3;<br /> n = n & n + 1 | n + 2 ^ n + 3;<br /> n >>= 2;
System.out.println(n);
}
}
what value will this print ? (choice 56, 7 , 14 , 24)
</pre> Every one knows the arithmetic operator precedence rules. How many people can remember the bitwise operator precedence rules . I did not find anything about this in the JLS. Had to find out the hard way. Incidentally its the same rules as that of boolean algebra.
Good luck.
Sahir
[This message has been edited by Sahir Shah (edited November 08, 2000).]