Logo

Programming-Idioms

History of Idiom 7 > diff from v8 to v9

Edit summary for version 9 by :

Version 8

2015-08-05, 08:25:05

Version 9

2015-08-13, 03:49:41

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