以下两个JAVA代码正在打印两个不同的输出:
int i = 0;
boolean t = true;
boolean f = false, b;
b = (t | ((i++) == 0));
b = (f | ((i += 2) > 0));
System.out.println(i);
输出 3
int i = 0;
boolean t = true;
boolean f = false, b;
b = (t || ((i++) == 0));
b = (f || ((i += 2) > 0));
System.out.println(i);
输出 2
这背后的原因是什么?