ArrayList Methods

AP Computer Science A· difficulty 4/5

<code>list.remove(Integer.valueOf(5))</code> (where list is ArrayList<Integer>) removes

  • A

    First element equal to 5

    check_circle
  • B

    All elements equal to 5

  • C

    Compile error

  • D

    Element at index 5

Explanation

The Integer overload removes the first occurrence of the value.

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

Related questions