Arrays.Stream으로 이차원 배열 출력하는 방법 정도는 기억해두면 좋을 것 같다.

package org.example;

import java.io.IOException;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int M = sc.nextInt();

        int [][] matrix1 = new int[N][M];
        int [][] matrix2 = new int[N][M];
        int [][] result = new int[N][M];

        for(int i = 0; i < N; i++){
            for(int j = 0; j < M; j++){
                matrix1[i][j] = sc.nextInt();
            }
        }

        for(int i = 0; i < N; i++){
            for(int j = 0; j < M; j++){
                matrix2[i][j] = sc.nextInt();
            }
        }

        for(int i = 0; i < N; i++){
            for(int j = 0; j < M; j++){
                result[i][j] = matrix1[i][j] + matrix2[i][j];
            }
        }

        Arrays.stream(result).forEach(row -> {
            Arrays.stream(row).forEach(value -> {
                System.out.print(value + " ");
            });
            System.out.println();
        });
    }
}