Please enable JavaScript to use CodeHS

AP CSA: VAR-2.E.4

CodeHS Lessons

Changing the size of an ArrayList while traversing it using an enhanced for loop can result in a ConcurrentModifcationException being thrown. Therefore, when using an enhanced for loop to traverse an ArrayList, you should not add or remove elements.

Standard
7.3 Traversing ArrayLists
Standard
5.4 Enhanced For Loops
Standard
8.4 Enhanced For Loops
Standard
7.4 Enhanced For Loops
Standard
14.3 Traversing ArrayLists
Standard
13.3 Traversing ArrayLists
Standard
7.4 Enhanced For Loops