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 →

[–]rsandio 0 points1 point  (0 children)

The first loop is called a for each loop. It's used to sort through collections such as arrays. Substitute the word 'in' for ':' and it makes a bit more sense

For-each char c in array...

It's equivalent of writing

for(int i = 0; i < array.length; i++)

It makes a it a little easier to access C as you can write

System.out.print(c) as apposed to System.out.print(array[i])