how to sum a 2d array in java

Solutions on MaxInterview for how to sum a 2d array in java by the best coders in the world

showing results for - "how to sum a 2d array in java"
Marc
05 Aug 2018
1for (int[] Array1 : Array) { //"Array" is the name of my array in this problem
2            
3	for (int colu = 0; colu < Array.length; colu++) { //"Colu" is the variable 
4      												  //so change it on your 
5      												  //code.
6      sum = sum + Array1[colu];
7    
8	}
9            
10}