Logo

Programming-Idioms

History of Idiom 7 > diff from v37 to v38

Edit summary for version 38 by :
Admin deletes impl 396

Version 37

2016-02-05, 08:21:55

Version 38

2016-02-05, 10:49:14

Idiom #7 Iterate over list indexes and values

Print each index i with its value x from an array-like collection items

Idiom #7 Iterate over list indexes and values

Print each index i with its value x from an array-like collection items

Code
for (final T x : items)
    System.out.println(x);
Comments bubble
Solution if the index is irrelevant.