How to use Iterator in Java with Example
Submitted By:
javabuddy
Rating:





(
Rate It)
Share:
By Email
Visit
Description
Iterators in Java are core of Collection package. They provide most important traversing functionality around objects stored in Collections.
No matter whether your objects are stored inside ArrayList, LinkedList, HashMap, HashSet or Vector , you can effectively use Iterator to navigate inside collection and same time remove objects from Collection safely. There are two kinds of Iterator in Java fail-safe and fail-fast, fail-safe iterator handles failure scenario elegantly while fail-fast iterator throws ConcurrentModification Exception. This article
gives a nice overview of Java Iterator and ListIterator and suggest how can you use both iterators based on scenarios and requirement.
Comments (1)
Reply




Posted by: SamSelly on Wednesday, December 07, 2011
I was bit confused with the concept but now after reading this article I sorted out my doubts. Thanks for sharing.
<a href="http://www.bathroomvanitiesforless.com">Cheap Bathroom Vanities</a>
Add Your Rating