public class jd{ public static void main(String a[]){ int x=0; booloan b1=b2=b3=b4=true; x=(b1 | b2 & b3 ^ b4) ? x++ : --x; System.out.println(x); } } please tell me where to begin while solving these problems thanks in advance payal
Hi Payal, The precedence order is: Bitwise/boolean AND Bitwise/boolean XOR Bitwise/boolean OR So your example would be like: x = (b1 | ((b2 & b3) ^ b4)) First: b2 & b3 = f1 Second: f1 ^ b4 = f2 Third: b1 | f2 Regards, Manfred.
Don't count your weasels before they've popped. And now for a mulberry bush related tiny ad: