I created a two-dimensional array in Java, and I was looking for a way to print it to the console so that I could confirm that the material I was doing was correct. I found code on the Internet that performed this task for me, but I had a question about what a specific bit of code meant.
int n = 10; int[][] Grid = new int[n][n]; //some code dealing with populating Grid void PrintGrid() { for (int i = 0; i < n; i++) { for (int j = 0; j < n; j++) { System.out.print(Grid[i][j] + " "); } System.out.print("\n"); } }
What does "\ n" do? I tried to search on Google, but since this is such a small code code, I could not find much.
java
dock_side_tough
source share