double d = Math.abs(-3.5);
System.out.println(d);What is printed?
- Acheck_circle
3.5
- B
-3.5
- C
3
- D
4
Explanation
Math.abs(double) returns the absolute value as a double, so -3.5 becomes 3.5.
AP Computer Science A· difficulty 2/5
double d = Math.abs(-3.5);
System.out.println(d);What is printed?
3.5
-3.5
3
4
Explanation
Math.abs(double) returns the absolute value as a double, so -3.5 becomes 3.5.
Want 10 more like this — adaptive to your weak spots?