Working of short circuit and unary operator
问题 Please have a look at the following code: int i=5; boolean b = i<5 && ++i<5;//line 2 System.out.println(i);//line 3, prints 5 In line 2, according to my understanding: Since among all the operators, ++ has highest precedence ++i should be evaluated first. But line 3 actually is printing i=5 (and not 6 ). Meaning, && has evaluated before ++ operator. How is it possible? EDIT: From the answers I see that "In Java, all expressions are evaluated from left to right.". But when does actually