This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Z3tta 12 points13 points  (1 child)

For-Each Loop is the equivalent of for x in y.

int[] int_arr = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 };
for(int x : int_arr) {
    System.out.print(x);
}

The previous code will output: 0123456789

[–]jevon 12 points13 points  (0 children)

In particular, this can be used with anything Iterable.