how to get absolute value of a 2D array
I'm trying to get the largest value after getting the sums of the columns in a two-dimensional array? this is my method so far help me. public static int AbsvalueFromAcolumn (int[][] array) { int yarray[] = new int[array.length]; for (int x [] : array ) { int count = 0; for (int column : x) { count += Math.abs(array[column][x]); } yarray[x] = count; } int absValue = yarray[0]; for (int b : yarray ) { if (yarray[b] > absValue ) { absValue = yarray[b];} } return absValue; Tried enhance loops and normal loops. expecting the largest absolute value from the individual sums of the columns or rows. a corrected example would be great. thanks in advance