Sorry guys, I'm a beginner in Java and I was wondering if I could get some help.
import java.util.Scanner;
import java.util. Arrays;
public class Matrices_Lab
{
public static int sumMat( int[][] matty )
{
//code
}
public static void main(String[] args)
{
int[][] mat = {{2,3,4},{55,66,77},{22,11}};
System.out.println( sumMat( mat ) );
}
}
the //code part is what I have to fill in. This is what I have so far but it is not working.
int[] finished_array;
for(int i=0; i<matty.length;i++){
for(int j=0; j<matty.length;j++){
int[] temp+= matty[j][i];
finished_array=temp;
Can someone help me out? How do I fill in the function to successfully make it work?