Short-Circuit Evaluation with Logical OR
What is printed when the following code segment is executed?
public class Main {
public static void main(String[] args) {
int a = 3, b = 5;
if(a < b || a++ > 3)
System.out.println(a);
else
System.out.println(b);
}
}
A
5
B
Compilation Error
C
4
D
3
APFIVE