• Develop code used to traverse the elements of an ArrayList and determine the results of these traversals

Assignment


Save for one caveat, this is a practice section. You’ve used loops and traversed arrays before, so little here is new.

The one catch is that you have to be careful when adding or removing items while looping through an ArrayList. Doing either will both change the size of the array and move items around, which you need to account for to avoid any errors.

Also, enhanced for loops can’t used in situations where the ArrayList changes size.