public static int eval() {
int a = 0;
int b = 0;
boolean t = (a++ > 0) && (b++ > 0);
return a * 10 + b;
}
// Call: System.out.println(eval());What is printed?
- A
11
- B
0
- C
1
- Dcheck_circle
10
Explanation
a++ returns 0 (not >0); a becomes 1. && short-circuits so b++ never runs. b=0. Result 1*10+0 = 10.