java - How can I return a 2 dimensions value to main method? -


// average of entire array private static int average(int[][] array){      (int row = 0; row < array.length; row++) {         (int col = 0; col < array[row].length; col++) {             int rowpcol= row*col;             int average= sum(array) / (rowpcol);          }        }     return average; } 

i getting error:

exception in thread "main" java.lang.error: unresolved compilation problem:  method average(int[][], int) in type hw8p1 not applicable arguments (int[][]) 

how can return method?

the reason getting exception have compilation error in code. correct compilation errors before attempt run code.

it in not clear causing compilation error. error message says attempting call method signature average(int[][], int) ... average method showed not have signature.

i suspect have shown code doesn't match attempting compile , run. explanation have forgotten recompile it. either way, can't fix code if show wrong version of code.

the compilation error points being problem way making call, not problem way result being returned.

one final point average of collection of integers integer. should calculating average floating point value; e.g. double.


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -