package com.company.Array; public class scores { public static void main(String[] args) { int[][] matrix = { {1,2,3}, {4,5,6}, {7,8,9} }; int student = 0; int exam = 0; for (int i = 0; i < matrix.length; i++) { System.out.println((student+i) + " Student"); for (int j = 0; j < matrix[0].length; j++) { System.out.println("---- " + " exam" + (exam+i) + matrix[i][j]); } } } }