@@ -0,0 +1,495 @@
+// Use for-each style for on a two-dimensional array.%0Aclass ForEach2 %7B%0A%09public static void main(String args%5B%5D) %7B%0A%09%09int sum = 0;%0A%09%09int nums%5B%5D%5B%5D = new int%5B3%5D%5B5%5D;%0A%09%09%0A%09%09// give nums some values%0A%09%09for(int i = 0; i %3C 3; i++)%0A%09%09%09for(int j=0; j %3C 5; j++)%0A%09%09%09%09nums%5Bi%5D%5Bj%5D = (i+1)*(j+1);%0A%09%09%0A%09%09// Use for-each for loop to display and sum the values.%0A%09%09for(int x%5B%5D : nums) %7B%0A%09%09%09for(int y : x) %7B%0A%09%09%09%09System.out.println(%22Value is: %22 + y);%0A%09%09%09%09sum += y;%0A%09%09%09%7D%0A%09%09%7D%0A%09%09System.out.println(%22Summation: %22 + sum);%0A%09%7D%0A%7D%0A

Use for-each style for on a two-dimensional array