Collection - Iterator.remove() vs Collection.remove()
问题 As per Sun , "Iterator.remove is the only safe way to modify a collection during iteration; the behavior is unspecified if the underlying collection is modified in any other way while the iteration is in progress." I have two questions : What makes this operation "Iterator.remove()" stable than the others ? Why did they provide a "Collection.remove()" method if it will not be useful in most of the use-cases? 回答1: If you're iterating over a collection and use: Collection.remove() you can get