Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Enhanced for loop -- multiple iterators?

843793Aug 6 2004 — edited Aug 9 2004
Does anyone know if the enhanced for loop syntax supports anything beyond the simple:
"for(Type var : Collection)" ? I know arrays are supported too. Anything else?

Any way to do fancier stuff like we can do with the multiple variables in the old for loop?
for (int i = 0, j; i < a.size(), i++, j = i * 2)

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 6 2004
Added on Aug 6 2004
7 comments
1,135 views