Below two JAVA codes are printing two different outputs:
int i = 0;
boolean t = true;
boolean f = false, b;
b = (t | ((i++) == 0));
b = (f | ((i += 2) > 0));
System.out.println(i);
Output: 3
int i = 0;
boolean t = true;
boolean f = false, b;
b = (t || ((i++) == 0));
b = (f || ((i += 2) > 0));
System.out.println(i);
Output: 2
What is the reason behind this?