e. bye 2 followed by ConcurrentModificationException. When the loop is iterating through the queue, you are not allowed to poll it since it changes the contents of the data structure. The same goes for offer(). Both these methods will appear on the exam.

The only question I have about this answer is, does it apply to all collections, or just those that extend Collection or just those that extend Queue, or just PriorityQueue.

The only question I have about this answer is, does it apply to all collections, or just those that extend Collection or just those that extend Queue, or just PriorityQueue.

This is an issue related to the behavior of the iterator (in relation to the collection). And it is implementation specific -- meaning that you'll have to keep a JavaDoc handy.

Most pre-java 5 collection's iterators, are designed to fail if the collection is changed, outside of the iterator. You can make changes, using the iterator, but changing it any other way will fail the iterator.

With Java 5, some iterators work on a "view" of the collection. If the collection is changed outside of the iterator, the iterator will actually still work on the unchanged copy of the collection.