This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Collections Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Collections" Watch "Collections" New topic


vuthlarhi donald
Ranch Hand

Joined: Jul 31, 2006
Posts: 76
what are the tree ways of traversing a list...I know that you can use the for each loop, iterator. what's the other one. and the advantages/disadvantages of this methods of transversing a list
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 38107
You can use an ordinary for loop, but the for-each loop is much neater.

Read the API documentation for the RandomAccess tagging interface to find out which is better.
I agree. Here's the link:
subject: Collections
Similar Threads
I have been to...
Favourite ice cream flavour ?
misc testing
Best Java IDE?
Scrabble... it only takes a minute...