 
                            ...
| Code Block | ||
|---|---|---|
| 
 | ||
| 
try {
    int i = 0;
    while(true) {
         a.doSomething();
         a[i++].next();
    }
} catch (ArrayIndexOutOfBoundsException e) {
    // end of array, ongoing routine
}
 | 
Wiki Markup 
Compliant Solution
A standard way of using for idiom can solve the problem.
...