ArrayList Methods

AP Computer Science A· difficulty 4/5

<code>new ArrayList<>(otherList)</code> creates

  • A

    A copy containing same elements as otherList

    check_circle
  • B

    Compile error

  • C

    Same reference

  • D

    An empty ArrayList

Explanation

Constructor accepts Collection; copies its elements.

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

Related questions