Here's a loop that would go through the values in your 2D array and print them out. It uses the .length thing.
for (int i = 0; i < grid.length; i++)
{
for (int j = 0; j < grid[i].length; j++)...
Type: Posts; User: javapenguin
Here's a loop that would go through the values in your 2D array and print them out. It uses the .length thing.
for (int i = 0; i < grid.length; i++)
{
for (int j = 0; j < grid[i].length; j++)...
Please post the code.
int[] value;
value = new int[1];
System.out.println(value[0]);
That prints 0 despite not being set.