// example that illustrates the creation of a few arrays, as well // as shows the automatic initialization of the array elements // (for built-in types) public class Array3 { public static void main(String[] args) { int[] list = {2, 4, 6, 8, 10}; // print contents System.out.println("Contents of integer array:"); for (int number : list) System.out.println("Next element: " + number); for (int num : list) { num = num + 5; System.out.println("Next element: " + num); } for (int number : list) System.out.println("Next element: " + number); } }