public class Lecture { public static void main(String[] args) { double[][] simul = { {3, 2, -1, 4.5}, {2.5, -1, 0, 1.7, 1, 1, 1, 1}, {1, 1, 1, 6} }; System.out.println(simul[1][1]); System.out.println("Sum = " + sum(simul)); } public static double sum(double[][] matrix) { double sum = 0.0; for(int row = 0; row < matrix.length; row++) { for(int col = 0; col < matrix[row].length; col++) { sum += matrix[row][col]; } } return sum; } }