Logo

Programming-Idioms

History of Idiom 7 > diff from v7 to v8

Edit summary for version 8 by :

Version 7

2015-08-05, 08:22:54

Version 8

2015-08-05, 08:25:05

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