public class MyArrayTest { public int[] scores = new int[5]; public void printScores() { for (int i = 0; i < scores.length; i++) { System.out.println(scores[i]); } } public static void print2DArray(int[][] arr) { for (int row = 0; row < arr.length; row++) { for (int col = 0; col < arr[row].length; col++) { System.out.print(arr[row][col] + " "); } System.out.println(); } } public static void main(String[] args) { int[][] table = new int[4][3]; for (int row = 0; row < table.length; row++) { for (int col = 0; col < table[row].length; col++) { table[row][col] = row * col; } } print2DArray(table); // Student jack; // jack = new Student(20); // jack.printAge(); // // Student[] students = new Student[5]; // // for (int i = 0; i < students.length; i++) // { // students[i] = new Student(keyboard.nextInt()); // students[i].printAge(); // } // // MyArrayTest mat = new MyArrayTest(); // mat.printScores(); // // mat.scores[2] = 57; // mat.printScores(); } }