ArrayList emptiness

Edit on Github instead

ArrayLists have a boolean isEmpty() method that returns true if there's no items in the list.

For example:

ArrayList<String> myList = new ArrayList<String>();
myList.isEmpty();             // returns true
myList.add("Hello");
myList.isEmpty();             // returns false

Suggest changes

Related links

URL Topic Source