To find out how many items there are, use the size() method:

Example

capitalCities.size();



Practice Excercise Practice now