Logical Operator Precedence
What is printed to the console when the following code is executed?
public class LogicTest {
public static void main(String[] args) {
boolean a = true;
boolean b = false;
System.out.println(a || b && a);
}
}
A
true
B
Runtime Error
C
Compilation Error
D
false
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | sailajavadlamani33 | 2 | 2 | 0m 00s | 200 |
| #2 | Ishaan.m.kurup | 1 | 1 | 0m 00s | 100 |
| #3 | sgarv2513 | 1 | 1 | 0m 00s | 100 |
| #4 | dinhhoa | 1 | 1 | 0m 00s | 100 |
| #5 | songqiuhui2012 | 1 | 1 | 0m 16s | 84 |
| #6 | psak12 | 1 | 1 | 0m 32s | 68 |
| #7 | chunxiangxu.cxu | 1 | 1 | 0m 38s | 62 |
| #8 | suhanakochhar006 | 1 | 1 | 0m 58s | 42 |
| #9 | varunrajaram1 | 1 | 1 | 1m 35s | 5 |
| #10 | y.seong2027 | 1 | 1 | 1m 49s | -9 |
Items per page:
10
1 – 10 of 11
APFIVE