Looping through arrays

Often an array is iterated through to perform some operation on each element in it.
Usually a for-loop is used in such a case, but it’s also possible to use other types of loop statements as shown in the example below where a character array is looped through and each element is printed out:

They all of course produce the same result:

Search for more Java info on this site here:
Custom Search

Any thoughts or questions?