By tag: Iterator
Ban this user: Options
Please provide a reason for deleting this story
When you first look at which statement to use to iterate through an ArrayList collection, the foreach statement stands out. It's syntax is concise and readable as well as no extra lines of code are needed to extract the element you want to work with. But...[pause for effect]...if the collection is...
Time for the next part in our series, the Iterator Pattern. Let's start with the definition: "Provide a way to access the elements of an aggregate object sequentially without exposing its underlying representation."