ArrayList Methods

AP Computer Science A· difficulty 2/5

To add 5 to the end of ArrayList<Integer> list:

  • A

    list[5] = 5;

  • B

    list.add(5);

    check_circle
  • C

    list = list + 5;

  • D

    list.append(5);

Explanation

Use <code>add(value)</code> to append.

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

Related questions