Suppose that i have the following code:
int j = 0;
boolean x = true, y = false, z;
z = (x || ((j++) == 0));
z = (y || ((j += 2) > 0));
the final value of j will be 2
z in the 1st assign, will have true or false, which is true
z in the 2nd assign, will have false or true, which is true
why the final value is 2? what is the difference between having true || false and false||true ?
I am not asking about "short-circuit" operators,
I just need more explanation for the assign operator, and how the first j didn't changed the value of j and the 2nd did.