public class Shunxu {
public static void main(String[] args) {
int a = 2,b = -2,c = 20;
if ((c--<30) || (b--<-2) && (a++<3))
System.out.print(a+" "+b+" "+c+"");
else
System.out.print("done");
}
运算结果是
2 -2 19
因为&&优先级高于||,所以运行时&&左右两侧的判断结合为一部分,即(c--<30) || {(b--<-2) && (a++<3)},由于c<30为true,故不在运行||右边的式子,所以只有c自减。