What is the value of <code>7 / 2</code> in Java when both operands are <code>int</code>?
- A
4
- Bcheck_circle
3
- C
3.5
- D
Compiler error
Explanation
Integer division truncates the fractional part: 7/2 = 3.
AP Computer Science A· difficulty 2/5
What is the value of <code>7 / 2</code> in Java when both operands are <code>int</code>?
4
3
3.5
Compiler error
Explanation
Integer division truncates the fractional part: 7/2 = 3.
Want 10 more like this — adaptive to your weak spots?