Does Java\'s foreach loop start at the first object and in a linear fashion work it\'s way to the end? For example
String[] names = new String[] {\"Zoe\", \"
Yes. The order is not changed. This applies to all types of collections of the Java Collection Framework implementing the iterator interface that is used by the for-loop. If you want to sort your Array, you can use Arrays.sort(names)