How to use Iterator in Java with Example

Submitted By: javabuddy
Rating: starstarstarstar (Rate It)
Share: Share By Email 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 starstarstarstar   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

(Not published)
star
starstar
starstarstar
starstarstarstar
starstarstarstarstar
 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.