We can iterate over a list in two different
ways - using iterator and using for-each loop.
Using iterator is more thread-safe because
it makes sure that if underlying list elements are modified, it will throw
ConcurrentModificationException.
No comments:
Post a Comment