View Single Post
Old Jul 27th, 2007, 10:08 PM   #10
357mag
Hobbyist Programmer
 
Join Date: Mar 2005
Posts: 148
Rep Power: 4 357mag is on a distinguished road
So let me get this straight. The first time through the loop the compiler is doing this:

0111 1011
1000 0000
----------
0000 0000    // Java interprets the whole thing as false since there is no 1's 
                  // present in any of the bit positions

Likewise the second time through the loop it does this:

0111 1011
0100 0000
----------
0100 0000    // Java interprets this as being true because there is a 1 bit
                  // present

So the compiler looks and does the math for all 8 columns, and if the end result shows a 1 in any of the bit positions, the if statement is true causing the compiler to print a 1.

So the compiler really does see and do the math for all the bit positions, not just one column at a time.
357mag is offline   Reply With Quote