Wrapper Classes: Integer and Double

AP Computer Science A· difficulty 3/5

<code>Integer.parseInt("42")</code> returns

  • A

    0

  • B

    42 (int)

    check_circle
  • C

    Throws exception

  • D

    "42" (String)

Explanation

Parses string to int. Throws <code>NumberFormatException</code> if not valid.

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

Related questions