Im trying to make a method that return true if the value of mat[r][k] is positive, but the error-message say "The method println(int) in the type PrintStream is not applicable for the arguments (int[][], int, int)
The call on the method:
public static void main(String[] args) {
int[][] matrix = { { 1, 2, 3 }, { 4, -5, 6 }, { -7, 8, 0 } };
System.out.println(isPositive(matrix), 2, 3);
}
The method:
public static String isPositive(int[][] mat, int r, int k) {
r--;
k--;
boolean value = false;
for (int i = 0; i < mat.length; i++) {
for (int j = 0; j < mat[i].length; j++) {
if (mat[r][k] > 0) {
value = true;
}
}
}
String out = "(" + mat[r][k] + ") : " + value;
return out;
}