Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Iterator Pattern

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please explain Iterator Pattern in JAVA by a simple example,Thanks in advance
[ November 11, 2008: Message edited by: simorgh hossein ]
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Iterator pattern is extensively used by all java Collection classes.
Nothing like going through the code and understanding yourself
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The java implementationof iterator pattern allows user to traverse carious types of data sets without worrying about the underlying implementation of collection. Since clients simply interact with the iterator for themselves. Some will allow full access to the underlying data sets while others may restrict certain functionalities, such as removing items.

---- "Design patterns" by Jason McDonald

For example, just open src.zip in your JAVA_HOME or whait a few ours till I found my old examples
 
Sergey Arnaut
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is example:



Any questions?
 
And tomorrow is the circus! We can go to the circus! I love the circus! We can take this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic