I haven't gone through it in detail, but take a look at :
if((++x> 2)|| (++y >2));
notice the || short-cut OR operator? that means if the left side is true, right side is never evaluated. So when ++x>2, it will never go to ++y>2 part, so that kind of explain why y is ended up with just 2. So go over the code few times and write in paper and see what happens.
yeah.this where is exactly my problem the left side.the right side i fully understand. why the left side stops at 8?
lets see x=0 y=0; x=1 y=1; x=2 y=2; x=3 if((++x>2)|| {++y >2)) true. i think it stops there with the third iteration of the loop,y is never touched again.
my question is why x==8 at end?not 10 or 12?or even x==3 and y==2?this exercice is in the book scjp(kathy sierra& bert bates).