The Artima Developer Community
Sponsored Link

Java Buzz Forum
Java for loop syntax for Iterators

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Paul Kilroy

Posts: 58
Nickname: paulkilroy
Registered: Jul, 2004

Paul Kilroy is a Frustrated Programmer
Java for loop syntax for Iterators Posted: Jul 20, 2004 6:15 PM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Paul Kilroy.
Original Post: Java for loop syntax for Iterators
Feed Title: The Frustrated Programmer
Feed URL: http://liberty.phpwebhosting.com/404.html
Feed Description: The problems I encounter on a daily basis, blogged for posterity. All content will be original, contain poor grammar and a few mispellings.
Latest Java Buzz Posts
Latest Java Buzz Posts by Paul Kilroy
Latest Posts From The Frustrated Programmer

Advertisement
Recently I found myself writing for loops that use Iterators a little differently. I used to write loops like this: Iterator fooIter = bar.getFoos(); Foo foo; while( fooIter.hasNext() ) { foo = (Foo)fooIter.next(); [...] } And now I've moved to this: for( Iterator fooIter = bar.getFoos().iterator(); fooIter.hasNext(); ) { Foo foo = (Foo)fooIter.next();

Read: Java for loop syntax for Iterators

Topic: [Jul 13, 2004 06:02 PDT] 7 Links Previous Topic   Next Topic Topic:

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use