This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Programming Diversions and the fly likes Iterator for an array Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "Iterator for an array" Watch "Iterator for an array" New topic
Author

Iterator for an array

Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1526
My friend sent me this code and asked me about the for loop there.


I said it will not work in 1.4 and though i bragged about enhanced-for loop in java 5., for the initial 2-3 mintues i was trying to fix an iterator for the variable 'list' even to put a breaking-point of hasNext() as the 'for condition'.

Only later i realaized... list was not a List... it was array.
[ January 17, 2008: Message edited by: Akhilesh Trivedi ]

Keep Smiling Always — My life is smoother when running silent. -paul
[FAQs] [Certification Guides] [The Linux Documentation Project]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Iterator for an array
 
Similar Threads
item object in loop
If in a While not working
Iterator or Enumeration
Array list > for loop or iterator
for loop and the list iterator