
264 Learning Java through Games
• for(int el: a){ ... a.remove(...) ... }⇒Will generate
ConcurrentModificationException because it is illegal to modify an array or an
ArrayList while there is an iterator (i.e., a for-each for loop) active on it.
11.10 Important Points
1. Before starting to write a big software system, we should always create a preliminary
design of our classes.
2. This design will change with time. New features will be added and existing features
will change. This is part of the development process.
3. Start by creating a small program and test it. Next, add new features incrementally
and always make sure that the current code is working ...