SE450
:
The ArrayList class
[38/53]
get
gets an element; no need to cast to correct type:
String country = countries.get(i);
set
sets an element
countries.set(1, "France");
size
method yields number of elements
for (int i = 0; i < countries.size(); i++) . . .
Or use "for each" loop
for (String country : countries) . . .