Logo

Programming-Idioms

History of Idiom 7 > diff from v9 to v10

Edit summary for version 10 by :

Version 9

2015-08-13, 03:49:41

Version 10

2015-08-13, 03:50:02

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 el : list)
    System.out.println(el);
Code
for (final T x : items)
    System.out.println(x);
Comments bubble
Solution if the index is irrelevant.
Comments bubble
Solution if the index is irrelevant.