int x = Math.abs(-7);
System.out.println(x);What is printed?
- Acheck_circle
7
- B
-7
- C
0
- D
1
Explanation
Math.abs returns the absolute value of its argument, so Math.abs(-7) returns 7.
AP Computer Science A· difficulty 2/5
int x = Math.abs(-7);
System.out.println(x);What is printed?
7
-7
0
1
Explanation
Math.abs returns the absolute value of its argument, so Math.abs(-7) returns 7.
Want 10 more like this — adaptive to your weak spots?