Wrapper Classes: Integer and Double

AP Computer Science A· difficulty 4/5

<code>Integer.parseInt("abc")</code> results in

  • A

    Returns -1

  • B

    Throws NumberFormatException

    check_circle
  • C

    Compile error

  • D

    Returns 0

Explanation

Cannot parse non-numeric → <code>NumberFormatException</code>.

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

Related questions