int result = 2 + 3 * 4;
System.out.println(result);What is printed?
- A
24
- B
20
- Ccheck_circle
14
- D
11
Explanation
Multiplication has higher precedence than addition, so 3 * 4 = 12 is computed first, then 2 + 12 = 14.
AP Computer Science A· difficulty 3/5
int result = 2 + 3 * 4;
System.out.println(result);What is printed?
24
20
14
11
Explanation
Multiplication has higher precedence than addition, so 3 * 4 = 12 is computed first, then 2 + 12 = 14.
Want 10 more like this — adaptive to your weak spots?