Here is what seems like a straightforward flow question from JQ+:
<pre>
class TestClass
{
public static void main(
String args[])
{
boolean b = false;
int i = 1;
do
{
i++ ;
} while (b = !b);
System.out.println( i );
}
}
</pre>
Why is the result 3 instead of 2? I know a do/while loop will always run at least once because it runs the loop before evaluating the condition, but in this case it seems to be running 2 times through?
Or have I been staring at my screen so long that I am missing where else the var is incremented?
Thanks,
Liz
------------------
Elizabeth Lester
SCJP Dreamin'