Java - Programming Language
This course covers the basics of programming in Java. Work your way through the videos/articles and I'll teach you everything you need to know to start your programming journey!

2d Arrays & Nested Loops

Lesson 23
Author : GOUP
Last Updated : September, 2020


Code

Copy// int [][] numberGrid = new int[2][3];
int [][] numberGrid = { {1, 2}, {3, 4} };
numberGrid[0][1] = 99;

System.out.println(numberGrid[0][0]);
System.out.println(numberGrid[0][1]);

for(int i = 0; i < numberGrid.length; i++){
     for(int j = 0; j < numberGrid[i].length; j++){
          System.out.println(numberGrid[i][j]);
     }
     System.out.println();
}