Using the Math Class

AP Computer Science A· difficulty 2/5

<code>Math.abs(-7)</code> returns

  • A

    0

  • B

    −7

  • C

    1

  • D

    7

    check_circle

Explanation

Absolute value: |−7| = 7.

Want 10 more like this — adaptive to your weak spots?

Related questions