ArrayList Methods

AP Computer Science A· difficulty 3/5

Check whether list has no elements:

  • A

    list.isEmpty()

  • B

    Both work; isEmpty is more readable

    check_circle
  • C

    list == null

  • D

    list.size() == 0

Explanation

Both equivalent; isEmpty() is idiomatic.

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

Related questions