Hidden Iterator in Collections toString()
Posted by
Shimi
Labels:
Collections,
Concurrency
The toString() method in the Java Collection invokes the toString() method of each item using Iterator.
In a multi-threaded environment a call to toString() should be synchronized to prevent ConcurrentModificationException.
Subscribe to:
Post Comments (Atom)
Post a Comment