This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv 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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "Iterator for an array" Watch "Iterator for an array" New topic

Iterator for an array

Akhilesh Trivedi
Ranch Hand

Joined: Jun 22, 2005
Posts: 1599
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]
I agree. Here's the link:
subject: Iterator for an array
It's not a secret anymore!