Hai everyone,
class Test{
public static void main(String args[]){
int x=0;
boolean b1,b2,b3,b4;
b1=b2=b3=b4=true;
x=(b1 | b2 & b3 ^b4) ? x++ : --x; // line 1
System.out.println(x);
}
}
The output of the above code is 0.And in the answer the line 1 is evaluated as (b1 | (b2 & (b3 ^ b4)).But the AND operator should be evaluated first in this type of expression.(I think i,m correct).I'm confused of this code.Can anyone clear my doubt.
Thanks
sudha