Using the Math Class

AP Computer Science A· difficulty 4/5

<code>(int) Math.round(3.6)</code> evaluates to

  • A

    4

    check_circle
  • B

    Compile error

  • C

    3

  • D

    3.6

Explanation

<code>Math.round(3.6)</code> returns 4 (long); cast to int = 4.

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

Related questions