public static int run() {
int x = 5;
if (x > 0 && x++ < 10 || x++ > 100) {
x += 1;
}
return x;
}
// Call: System.out.println(run());What is printed?
- Acheck_circle
7
- B
8
- C
5
- D
6
Explanation
x>0 true. x++ <10: post-inc returns 5 (true), x becomes 6. && both true. || short-circuits (no second x++). Then x+=1 makes x=7.